Solveeit Logo

Question

Question: Solve the following differential equation: \[\dfrac{dy}{dx}+y\tan x=\cos x\]...

Solve the following differential equation:
dydx+ytanx=cosx\dfrac{dy}{dx}+y\tan x=\cos x

Explanation

Solution

Hint: The given differential equation is a first degree linear differential equation of the form dydx+Py=Q\dfrac{dy}{dx}+Py=Q. The solution is given by:
y×I.F=Q×I.F.dx+cy\times I.F=\int{Q\times I.F.dx+c}
where I.F=ePdxI.F={{e}^{\int{Pdx}}}
So we will first calculate an integrating factor known as I.F then we will substitute it in the equation of solution.

Complete step-by-step answer:
We have been given the differential equation dydx+ytanx=cosx\dfrac{dy}{dx}+y\tan x=\cos x.
It is of the form dydx+Py=Q\dfrac{dy}{dx}+Py=Q known as first degree differential equation and the solution is given by,
y×I.F=Q×I.Fdx+cy\times I.F=\int{Q\times I.Fdx+c}
where I.F=ePdxI.F={{e}^{\int{Pdx}}}
So we have where P=tanxP=\tan x and Q=cosxQ=\cos x.
Now we will calculate the value of I.F as follows:
I.F=ePdx=etanxdxI.F={{e}^{\int{Pdx}}}={{e}^{\int{\tan xdx}}}
Since we know that tanxdx=ln(secx)\int{\tan xdx}=ln\left( \sec x \right)
I.F=eln(secx)\Rightarrow I.F={{e}^{ln\left( \sec x \right)}}
Also, we know that elnt=t{{e}^{lnt}}=t
I.F=secx\Rightarrow I.F=\sec x
So the equation of the given differential equation is given as follows:
ysecx=secxcosxdx+cy\sec x=\int{\sec x\cos xdx+c}
Since we know that secx=1cosx\sec x=\dfrac{1}{\cos x}

& \Rightarrow y\sec x=\int{\dfrac{1}{\cos x}\times \operatorname{cosxdx}}+c \\\ & \Rightarrow y\sec x=\int{dx+c} \\\ \end{aligned}$$ $$\Rightarrow y\sec x=x+c$$, where c is any arbitrary constant. Therefore, the solution of the given differential equation is equal to $$y\sec x=x+c$$. Note: Be careful while finding the value of I.F, i.e. integrating factor. Sometimes we just forget that the term $$\int{Pdx}$$ is on the power to ‘e’ and we use the I.F is equal to the value obtained by $$\int{Pdx}$$ which gives us the wrong result. Also, don’t forget to mention plus ‘c’ in the final solution which is an arbitrary constant.