# First ODE

iRaid

## Homework Statement

$$y'+ycot(x)=cos(x)$$

## 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..

Homework Helper

## Homework Statement

$$y'+ycot(x)=cos(x)$$

## 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..

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$$