Solveeit Logo

Question

Question: Solve the differential equation: \(\dfrac{dy}{dx}+2y\tan x=\sin x\)...

Solve the differential equation:
dydx+2ytanx=sinx\dfrac{dy}{dx}+2y\tan x=\sin x

Explanation

Solution

Hint: Observe that the given differential equation is a linear differential equation, i.e. a differential equation of the form dydx+P(x)y=Q(x)\dfrac{dy}{dx}+P\left( x \right)y=Q\left( x \right). The solution of a linear differential equation is given by
yI.F=Q(x)I.FdxyI.F=\int{Q\left( x \right)I.Fdx}, where IF=eP(x)dxIF={{e}^{\int{P\left( x \right)dx}}}. Find the integrating factor of the given differential equation and hence find the solution of the given equation. Verify your answer.

Complete step-by-step answer:
We have dydx+2ytanx=sinx\dfrac{dy}{dx}+2y\tan x=\sin x, which is of the form of dydx+P(x)y=Q(x)\dfrac{dy}{dx}+P\left( x \right)y=Q\left( x \right).
Here P(x)=2tanxP\left( x \right)=2\tan x and Q(x)=sinxQ\left( x \right)=\sin x.
Now, we know that the integrating factor IF of a linear differential equation is given by
IF=eP(x)dxIF={{e}^{\int{P\left( x \right)dx}}}
Hence, the integrating factor of the given differential equation is given by
IF=e2tanxdxIF={{e}^{\int{2\tan xdx}}}.
We know that tanxdx=ln(secx)+C\int{\tan xdx}=\ln \left( \sec x \right)+C
Hence, we have IF=e2ln(secx)=eln(sec2x)IF={{e}^{2\ln \left( \sec x \right)}}={{e}^{\ln \left( {{\sec }^{2}}x \right)}}
We know that elnx=x{{e}^{\ln x}}=x
Hence, we have
IF=sec2xIF={{\sec }^{2}}x
Now, we know that the solution of a linear differential equation is given by
yIF=Q(x)IFdxyIF=\int{Q\left( x \right)IFdx}
Hence, the solution of the given equation is
ysec2x=sinxsec2xdxy{{\sec }^{2}}x=\int{\sin x{{\sec }^{2}}xdx}
Now, we have
sinxsec2x=sinxsecxsecx=sinxcosxsecx=secxtanx\sin x{{\sec }^{2}}x=\sin x\sec x\sec x=\dfrac{\sin x}{\cos x}\sec x=\sec x\tan x
Hence, we have
ysec2x=secxtanxdxy{{\sec }^{2}}x=\int{\sec x\tan xdx}
We know that
secxtanxdx=secx\int{\sec x\tan xdx}=\sec x
Hence, we have
ysec2x=secx+Cy{{\sec }^{2}}x=\sec x+C
Dividing both sides by sec2x{{\sec }^{2}}x, we get
y=cosx+Ccos2xy=\cos x+C{{\cos }^{2}}x, which is the required solution of the given differential equation.

Note: Verification.
We have
y=cosx+Ccos2xy=\cos x+C{{\cos }^{2}}x
Differentiating both sides, we get
dydx=sinx2Csinxcosx\dfrac{dy}{dx}=-\sin x-2C\sin x\cos x
Adding 2ytanx2y\tan x on both sides, we get
dydx+2ytanx=sinx2Csinxcosx+2tanx(cosx+Ccos2x)\dfrac{dy}{dx}+2y\tan x=-\sin x-2C\sin x\cos x+2\tan x\left( \cos x+C{{\cos }^{2}}x \right)
We have tanxcosx=sinxcosxcosx=sinx\tan x\cos x=\dfrac{\sin x}{\cos x}\cos x=\sin x
Hence, we have
dydx+2ytanx=sinx2Csinxcosx+2sinx+2Csinxcosx\dfrac{dy}{dx}+2y\tan x=-\sin x-2C\sin x\cos x+2\sin x+2C\sin x\cos x
Simplifying, we get
dydx+2ytanx=sinx\dfrac{dy}{dx}+2y\tan x=\sin x, which is the given differential equation.
Hence our answer is verified to be correct.