# Linear First order ODE problem

1. Oct 26, 2008

### Vuldoraq

1. The problem statement, all variables and given/known data

x$$(\theta)$$= x tanθ−cosθ

2. Relevant equations

The integrating factor is (note it should be negative tan, but the latex won't display it);

$$I= \int -tan \theta\ d \theta$$

The solution is given by;

$$x \ e^{I}=-\int \ e^{I}*cos\theta\ d \theta$$

3. The attempt at a solution

$$I=\int \tan \theta\ d \theta$$
$$=-(-\ln|cos \theta |)$$

So, $$e^{I}=cos \theta$$

Therefore,

$$x*cos \theta = \int \ cos^{2} \theta d \theta$$

Using the half angle formulae gives,

$$x*cos \theta =\frac{1}{2} \int \cos(2 \theta) +1$$

Which, after integration and simplification gives,

$$x=-\frac{1}{2}*(sin \theta + \theta\ sec\theta)$$

When I check my answer I end up with zero,

$$\frac{dx}{d \theta}=-\frac{1}{2}*(cos \theta \ +\ sec\theta \ +\ \theta*sec \theta \tan \theta)$$

$$x*tan \theta=-\frac{1}{2}*(sin \theta * tan \theta + \theta* sec \theta* tan \theta)$$

$$\frac{dx}{d \theta}-x*tan \theta=\frac{1}{2}*[(\frac{cos^{2}\theta\ {-1}}{cos \theta}-\theta* sec \theta* tan \theta)-(-\frac{sin^{2} \theta}{cos \theta}-\theta* sec \theta* tan \theta)]$$

$$=\frac{sin^{2} \theta \ - \ (1-cos^{2} \theta)}{2* cos \theta}=0$$

Please could someone go through my calculation and see where my mistake is?

Last edited: Oct 26, 2008
2. Oct 26, 2008

### HallsofIvy

Staff Emeritus
I have corrected that: you had a "\" before the "-".

Haven't you forgotten the "-" on the right side?

After integration, this is x cos(theta)= 1/2(theta)- (1/4) sin(2\theta)

You appear to have forgotten the "-" on the "- cos(theta)" to begin, with as well as the "2" in the 2 theta, and, finally, the theta from integrating "1".

3. Oct 26, 2008

### Vuldoraq

Hi HallsofIvy,

I've always struggled with minus signs, I find them really confusing!

When I simplified I used $$\frac{1}{2}sin 2\theta=sin\theta*cos\theta$$.

Popping in that minus and the missing theta gave me the correct solution, I think.

$$x=-\frac{1}{2}sin\theta + \theta*cos\theta$$

To check;

$$\frac{dx}{d\theta}=-\frac{1}{2}*(cos\theta + sec\theta + \theta*sec\theta*tan\theta)$$

$$x*tan\theta=-\frac{1}{2}*(\frac{sin^{2}\theta}{cos\theta} + \frac{\theta*sin\theta}{cos^{2}\theta})$$

$$\frac{dx}{d\theta}-x*tan\theta=-\frac{1}{2}*(cos\theta + sec\theta + \theta*sec\theta*tan\theta - \frac{sin^{2}\theta}{cos\theta} -\frac{\theta*sin\theta}{cos^{2}\theta})$$

$$=-\frac{1}{2}*[\frac{cos^{2}\theta + 1 -sin^{2}\theta}{cos\theta}]$$

$$=-\frac{1}{2}*[\frac{2*cos^{2}\theta -1 + 1}{cos\theta}]=-cos\theta$$

Does this look reasonable to you?

Thanks for your help, I was going round in circles with that problem!