An online text explaining rotation of axes includes this step:

x = X cos - Y sin

y = X sin + Y cos

By solving Equations (above) for X and Y we obtain

X = x cos +y sin

Y = -x sin + y cos

How do they get from the upper equations to the lower ones? Thanks in advance.