I have an equation that looks like $$X' = a \sin(X) + b \cos(X) + c$$ where $a,b$ and $c$ are constants. For given values of $a, b$ and $c$ how can I calculate X? I have set of values for $a, b$ and $c$ and I am looking for an equation that could solve for $X$ or other approaches like numerical methods are also ok. Thanks in advance.
My approach is as below: $$X' = a \sin(X) + b \cos(X) + c \ (Integrating \ this \ eqn)$$ $$X = d \cos(X) + b \sin(X) + cX \\where(d = -a)$$ $$X = p\sin(X + q) + cX \\where \ p= sqrt(d^2 + b^2) \ and \ cosq = d/p ,\ sinq=b/p$$ $$X(1-c)/p = sin(X+q) \\ where \ p/(1-c) = r$$ $$X - rsin(X+q) = 0$$ $$f(X) = X - r \ sin(X+q) \\ f'(X) = 1 - rcos(X+q)$$ To the above equations I applied Newton's method: $$X(n+1) = X(n) - f(X(n))/f'(X(n)) \\ X(0) = 1$$ I run this for 2000 Iterations and found theat the solution is not converging to expected result. Is there something wrong with the mathematical derication ? or It is not possible to get results from this approach?
direct transformation using half-angle formulas
The probably best systematic method (from integrals of quotients of trigonometric expressions) is the half-angle tangent substitution. Set $U=\tan(X/2)$, then $\sin(X)=\frac{2U}{1+U^2}$, $\cos(X)=\frac{1-U^2}{1+U^2}$ and $$ U'=(1+U^2)X'=2aU+b(1-U^2)+c(1+U^2) $$ which now has a quadratic right side and can be solved via partial fraction decomposition. Or one can see it as a Riccati equation, and get with the further substitution $U=\frac{V'}{(b-c)V}$ a second order linear ODE with constant coefficients.
correct integration using separation of variables
As to your edit: separation of variables leads to $$ \int\frac{dX}{a\sin X+b\cos X+c}=t+k. $$ Here then you proceed with the integral of a rational trigonometric expression, naturally inviting to apply the half angle formula.
direct approach continued, (implicit) partial fraction decomposition
You can solve the transformed equation or the integral by finding the roots of the quadratic, so that $$ U' = (c-b)(U-r_1)(U-r_2) $$ and the appropriate transformation is $V=\frac{U-r_1}{U-r_2}$ transforming it into a linear first order ODE. $$ V'=\frac{r_1-r_2}{(U-r_2)^2}U'=(r_1-r_2)(c-b)V\implies V=Ce^{(r_1-r_2)(c-b)t} $$ where the roots $r_k$ are of the quadratic equation $[(c-b)r]^2-2a[(c-b)r]+(c^2-b^2)=0$.
using the approach via a second order linear ODE
A more direct solution comes from the Riccati transformation into a second order ODE, $V=\exp((b-c)\int U\,dt)$, so that $$ \frac{V''}{(b-c)V}-\frac{V'^2}{(b-c)V^2}=(b+c)+2a\frac{V'}{(b-c)V}-(b-c)\frac{V'^2}{(b-c)^2V^2} \\\implies V''-2aV'+(c^2-b^2)V=0 $$ which again is easy to solve, and the back-substitutions here are IMO easiest to perform.