# Integration of a differential equation

#### Beard

Hi,

I am unsure if I am getting the correct answer to my problem, I have to find y

$$\displaystyle \frac{dy}{dx} = y\cos(x)$$ which goes to

$$\displaystyle \int\frac{1}{\cos(x)\cdot dx} = \int\frac{y}{dy}$$ then

$$\displaystyle ln(\cos(x)) + c = y^2$$ therefore

$$\displaystyle y = \sqrt{ln(\cos(x)) + c}$$

Is this correct, if not where am i going wrong?

Thanks

#### Sudharaka

Hi,

I am unsure if I am getting the correct answer to my problem, I have to find y

$$\displaystyle \frac{dy}{dx} = y\cos(x)$$ which goes to

$$\displaystyle \int\frac{1}{\cos(x)\cdot dx} = \int\frac{y}{dy}$$ then

$$\displaystyle ln(\cos(x)) + c = y^2$$ therefore

$$\displaystyle y = \sqrt{ln(\cos(x)) + c}$$

Is this correct, if not where am i going wrong?

Thanks
Dear Beard,

$$\displaystyle \frac{dy}{dx} = y\cos~x$$

$$\displaystyle \frac{1}{y}\frac{dy}{dx}=cos~x$$

Now integrate both sides with respect to x,

$$\displaystyle \int{\frac{1}{y}\frac{dy}{dx}}dx=\int{cos~x}~dx$$

$$\displaystyle \int{\frac{1}{y}}dy=sin~x+C$$ ; Cis an arbitary constant.

$$\displaystyle ln\mid{y}\mid=sin~x+C$$

• Beard

#### Beard

Nice and clear to follow thankyou

#### HallsofIvy

MHF Helper
And never, ever again write "$$\displaystyle \int \frac{f(x)}{dx}$$"!!!

• AllanCuz