# First ODE

1. Sep 13, 2013

### iRaid

1. The problem statement, all variables and given/known data
$$y'+ycot(x)=cos(x)$$

2. Relevant equations

3. The attempt at a solution
First I found the integrating factor:
$$\rho (x)=e^{\int cot(x)dx}=e^{ln(sinx)}=sinx$$
Plug into the equation for first order DE...
$$\int \frac{d}{dx} ysinx=\int cosxsinx dx$$
End up with:
$$ysinx=\frac{-cos^{2}x}{2}+C\\y=\frac{-cosxcotx}{2}+\frac{C}{sinx}$$

I think that's wrong tho..

2. Sep 13, 2013

### pasmith

You have the right answer. But since $\cos^2 x + \sin^2 x = 1$, it follows that $(\sin^2 x)' = -(\cos^2 x)'$. Perhaps it would have been better to take $\sin x \cos x = \frac12(\sin^2 x)'$, since you have $(y\sin x)'$ on the other side of the equation.

You can in any event use $\cos^2 x + \sin^2 x = 1$ to simplify your answer:
$$\frac{\cos^2 x}{\sin x} = \frac{1 - \sin^2 x}{\sin x} = \frac{1}{\sin x} - \sin x$$