# First Order Non-Linear ODE

1. Apr 20, 2013

### *FaerieLight*

Hi! I'm having a lot of trouble solving the following ODE:

dx/dt = A - B*sin(x)

where A and B are constants. My ODE skills are a bit rusty, and I wasn't able to find anything on the Internet that could help me, so could someone please show me how to solve for x in terms of t?

I've tried rearranging the equation to get:

x = At - B ∫$\frac{sin(x)}{A-B*sin(x)}$ dx

and I tried solving that and I got a very complicated expression involving inverse tan, which I am not sure is correct. I don't want to do it this way by direct integration if there is a much easier way to solve the ODE. But if there isn't, then :grumpy:.

Thanks a lot!!

2. Apr 20, 2013

### Simon Bridge

That's an odd rearrangement - how did you get that?
Did you try using direct separation of variables?

3. Apr 20, 2013

### Jay_

You have rearranged it wrong I think. If you have dx/dt = A - B*sin(x), wouldn't you have have dt = dx/(A - B*sin(x))?

Then integrating both sides: t = -(2/C)*arctan(D) + constant.

C = (A^2 - B^2)^(1/2)
D = (B -A*tan(x/2))/C

Wolfram alpha gave me the value of that integral. I am not sure how the A coefficient gets to the tan function, but to find out, one could try using the Weierstrass substitution: sin(x) = 2u/(1 + u^2) and dx = du/1 + u^2, after that you would have to use partial fractions to evaluate the integral of the reciprocal of the quadratic.

Last edited: Apr 20, 2013
4. Apr 21, 2013

### *FaerieLight*

Hi! Thanks for your help!! What I meant by rearranging is that I just put dx/dt on the LHS and A-B*sin(x) on the RHS, and then integrated both sides with respect to t, so that I got an integral of sin(x) with respect to t. I then rewrote dt as dt/dx * dx, and got an expression in terms of sin(x) for dt/dx from the original ODE, which led to the sin(x) on A-B*sin(x) integral over x.

Doing it using the separation of variables actually makes other calculations I have to do (get an expression for sin(x)) much more manageable than what I was doing before. So thanks!!