# Thread: 5*sin X + 7*cos X = 7.830127019 solve for X?

1. ## 5*sin X + 7*cos X = 7.830127019 solve for X?

5*sin X + 7*cos X = 7.830127019

Can this equation be solved for X? I don't think so, but it's worth a try here. It's not homework, but the result of a long series of equations that I'm trying to evaluate to generate seed values for the coefficients for a matrix.

My actual equation is:
(X2-X1)/S = (x2C2-y2C1-x1C2+y1C1)*cos(phi) + (z2-z1)*sin(phi)

Solve for Phi. X1, X2, S, x1, y1, z1, x2, y2, z1, z2, C1, and C2 are all known values. The only unknown is phi, but I don't think the equation can be solved for Phi. Thanks!

2. Let me solve the first equation. The second equation is beyond me.

5*sin X + 7*cos X = 7.830127019 --------(1)

Here is one way.
The first equation involves sinX and cosX. To solve for X, we convert sinX into cosX (or cosX into sinX) so that we have only one variable.

The Pythagorean trig identity:
sin^2(X) +cos^2(X) = 1 -----------(i)
Let us have sinX only, so,
cos^2(X) = 1 -sin^2(X)
cosX = sqrt[1 -sin^2(X)] ------(ii)

Substitute that into (1),
5sinX +7*sqrt[1 -sin^2(X)] = 7.830127019
7*sqrt[1 -sin^2(X)] = 7.830127019 -5sinX
Clear the radical, square both sides,
49[1 -sin^2(X)] = (7.830127019)^2 -2(7.830127019)(5sinX) +25sin^2(X)
49 -49sin^2(X) = 61.31088913 -78.30127019sinX +25sin^2(X)
Bring them all to the rightside, [since the sin^2(X) is positive there. :-)],
0 = [25 +49]sin^2(X) -[78.30127019]sinX +[61.31088913 -49]
0 = 74sin^2(X) -78.30127019sinX + 12.31088913
Get its simplest form, divide both sides by 74,
0 = sin^2(X) -1.058125273sinX +0.166363367
Or,
sin^2(X) -1.058125273sinX +0.166363367 = 0 ----(iii)

That is a quadratic equation in sinX.
Use the quadratic formula and you should get
sinX = 0.866 or 0.1921.

Therefore,
X = arcsin(0.866) or arcsin(0.1921)
X = 60degrees or 11.07536 degrees ----answer.
Or

3. There's a general approach to A sin X + B cos X = C which may be quicker. Divide through by sqrt(A^2 + B^2) to give a sin X + b cos X = c where a = A/sqrt(A^2+B^2) etc, and where a^2+b^2 = 1. Then a = cos Y and b = sin Y where Y = arctan(b/a) = arctan(B/A). So sin(X+Y) = c. Then X = arcsin(c) - Y.