# Solve $\cos^2{x}\dfrac{dy}{dx}$ $+$ $y$ $\,=\,$ $\tan{x}$

The given equation is a differential equation of first order and first degree. In this differential equation, the product of square of cosine of angle $x$ and the derivative of $y$ with respect to $x$ is added to the variable $y$. It is given that the value of sum of the terms is equal to the tan of angle $x$.

$\cos^2{x}\dfrac{dy}{dx}$ $+$ $y$ $\,=\,$ $\tan{x}$

Now, let’s learn how to solve this first order differential equation.

### Convert the equation into Leibnitz’s form

The given first order differential equation is similar to the Leibniz’s linear differential equation but the coefficient of the derivative of $y$ with respect to $x$ should be eliminated. Hence, divide both sides of the equation by the cosine squared of angle $x$.

$\implies$ $\dfrac{\cos^2{x}\dfrac{dy}{dx}+y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{\cos^2{x}\dfrac{dy}{dx}}{\cos^2{x}}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{\cos^2{x} \times \dfrac{dy}{dx}}{\cos^2{x}}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{\cos^2{x}}{\cos^2{x}} \times \dfrac{dy}{dx}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{\cancel{\cos^2{x}}}{\cancel{\cos^2{x}}} \times \dfrac{dy}{dx}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $1 \times \dfrac{dy}{dx}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{dy}{dx}$ $+$ $\dfrac{y}{\cos^2{x}}$ $\,=\,$ $\dfrac{\tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{dy}{dx}$ $+$ $\dfrac{1 \times y}{\cos^2{x}}$ $\,=\,$ $\dfrac{1 \times \tan{x}}{\cos^2{x}}$

$\implies$ $\dfrac{dy}{dx}$ $+$ $\dfrac{1}{\cos^2{x}} \times y$ $\,=\,$ $\dfrac{1}{\cos^2{x}} \times \tan{x}$

According to the reciprocal identity of cosine function, the multiplicative inverse of cosine squared of angle $x$ is equal to the square of secant of angle $x$.

$\implies$ $\dfrac{dy}{dx}$ $+$ $\sec^2{x} \times y$ $\,=\,$ $\sec^2{x} \times \tan{x}$

$\,\,\,\therefore\,\,\,\,\,\,$ $\dfrac{dy}{dx}$ $+$ $(\sec^2{x})y$ $\,=\,$ $\sec^2{x}\tan{x}$

The given differential equation of first order and first degree is successfully transformed into the form of Leibniz’s linear differential equation.

Therefore, $P \,=\, \sec^2{x}$ and $Q \,=\, \sec^2{x}\tan{x}$

### Find the Integrating factor

Now, let us find the integrating factor by the following rule.

$I.F$ $\,=\,$ $e^{\displaystyle \int{P}\,dx}$

$\implies$ $I.F$ $\,=\,$ $e^{\displaystyle \int{\sec^2{x}}\,dx}$

Use the integral rule of square of secant function to find the indefinite integration of the secant squared of angle $x$.

$\,\,\,\therefore\,\,\,\,\,\,$ $I.F$ $\,=\,$ $e^{\displaystyle \tan{x}}$

### Find the solution of differential equation

It is time to find the solution for Leibnitz’s linear differential equation.

$y(I.F)$ $\,=\,$ $\displaystyle \int{Q(I.F)}\,dx+c$

Now, substitute the integrating factor and the function $Q$ in the solution.

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{\sec^2{x}\tan{x}\big(e^{\displaystyle \tan{x}}\big)}\,dx+c$

There is nothing to do on left-hand side of the equation. So, let’s focus on finding the indefinite integration on right hand side of the equation.

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{\tan{x}\big(e^{\displaystyle \tan{x}}\big)\sec^2{x}}\,dx+c$

The trigonometric function $\tan{x}$ is a first factor and is also at exponent position in second factor. The third factor is also its derivative in this function. In this case, it is recommendable to minimize the number of multiplying factors and it is useful to find the integration of this function easily.

Take $z = \tan{x}$

Now, differentiate this equation with respect to $x$.

$\implies$ $\dfrac{d}{dx}{(z)} \,=\, \dfrac{d}{dx}{(\tan{x})}$

Use the derivative rule of tan function to find its differentiation with respect to $x$.

$\implies$ $\dfrac{dz}{dx} \,=\, \sec^2{x}$

$\implies$ $dz \,=\, \sec^2{x} \times dx$

$\implies$ $dz \,=\, \sec^2{x}\,dx$

$\,\,\,\therefore\,\,\,\,\,\,$ $\sec^2{x}\,dx \,=\, dz$

Consider $z = \tan{x}$ and $\sec^2{x}\,dx \,=\, dz$. Now, convert the right hand side expression in terms of $z$.

$y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{\tan{x}\big(e^{\displaystyle \tan{x}}\big)\sec^2{x}}\,dx+c$

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{z\big(e^{\displaystyle z}\big)}\,dz+c$

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{z e^{\displaystyle z}}\,dz+c$

On the right-hand side of the equation, the functions are multiplying inside the integral. So, the indefinite integral of the multiplying functions can be calculated by the integration by parts.

Take $u = z$ and $dv = e^{\displaystyle z}dz$

Now, differentiate the equation $u = z$ with respect to $z$.

$\implies$ $\dfrac{d}{dz}{(u)} \,=\, \dfrac{d}{dz}{(z)}$

$\implies$ $\dfrac{du}{dz} \,=\, \dfrac{dz}{dz}$

$\implies$ $\dfrac{du}{dz} \,=\, 1$

$\implies$ $du \,=\, 1 \times dz$

$\,\,\,\therefore\,\,\,\,\,\,$ $du \,=\, dz$

Now, integrate the both sides of the equation $dv = e^{\displaystyle z}dz$.

$\implies$ $\displaystyle \int{}dv \,=\, \displaystyle \int{e^{\displaystyle z}}\,dz$

According to the integral rule of one, the integral of one with respect to $v$ can be calculated. The integral of natural exponential function with respect to $z$ can be evaluated as per the integral rule of natural exponential function.

$\,\,\,\therefore\,\,\,\,\,\,$ $v \,=\, e^{\displaystyle z}$

$y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\displaystyle \int{z\big(e^{\displaystyle z}\big)}\,dz+c$

It is time to implement the integration by parts formula for the above expression.

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $z\times e^{\displaystyle z}$ $-$ $\displaystyle \int{e^{\displaystyle z}}\,dz+c$

Use the integral rule of natural exponential function one more time to find the solution for the Leibniz’s linear differential equation.

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $z\times e^{\displaystyle z}$ $-$ $e^{\displaystyle z}+c$

The right hand side expression of the solution is obtained in terms of $z$. So, it should be expressed in terms $x$ by replacing $z = \tan{x}$.

$\implies$ $y\big(e^{\displaystyle \tan{x}}\big)$ $\,=\,$ $\tan{x}\times e^{\displaystyle \tan{x}}$ $-$ $e^{\displaystyle \tan{x}}+c$

$\implies$ $y \times e^{\displaystyle \tan{x}}$ $\,=\,$ $\tan{x}\times e^{\displaystyle \tan{x}}$ $-$ $e^{\displaystyle \tan{x}}+c$

There is a common factor in most of the terms in the solution. For simplifying the equation, divide both sides of the equation by $e$ raised to the power $\tan{x}$.

$\implies$ $\dfrac{y \times e^{\displaystyle \tan{x}}}{e^{\displaystyle \tan{x}}}$ $\,=\,$ $\dfrac{\tan{x}\times e^{\displaystyle \tan{x}}-e^{\displaystyle \tan{x}}+c}{e^{\displaystyle \tan{x}}}$

$\implies$ $\dfrac{y \times e^{\displaystyle \tan{x}}}{e^{\displaystyle \tan{x}}}$ $\,=\,$ $\dfrac{\tan{x}\times e^{\displaystyle \tan{x}}}{e^{\displaystyle \tan{x}}}$ $-$ $\dfrac{e^{\displaystyle \tan{x}}}{e^{\displaystyle \tan{x}}}$ $+$ $\dfrac{c}{e^{\displaystyle \tan{x}}}$

$\implies$ $\dfrac{y \times \cancel{e^{\displaystyle \tan{x}}}}{\cancel{e^{\displaystyle \tan{x}}}}$ $\,=\,$ $\dfrac{\tan{x}\times \cancel{e^{\displaystyle \tan{x}}}}{\cancel{e^{\displaystyle \tan{x}}}}$ $-$ $\dfrac{\cancel{e^{\displaystyle \tan{x}}}}{\cancel{e^{\displaystyle \tan{x}}}}$ $+$ $\dfrac{c}{e^{\displaystyle \tan{x}}}$

$\implies$ $y$ $\,=\,$ $\tan{x}$ $-$ $1$ $+$ $\dfrac{c}{e^{\displaystyle \tan{x}}}$

The third term on the right hand side expression can be written as follows as per the negative exponent rule.

$\implies$ $y$ $\,=\,$ $\tan{x}$ $-$ $1$ $+$ $c \times e^{\displaystyle -\tan{x}}$

$\,\,\,\therefore\,\,\,\,\,\,$ $y$ $\,=\,$ $\tan{x}$ $-$ $1$ $+$ $ce^{\displaystyle -\tan{x}}$

A best free mathematics education website for students, teachers and researchers.

###### Maths Topics

Learn each topic of the mathematics easily with understandable proofs and visual animation graphics.

###### Maths Problems

Learn how to solve the math problems in different methods with understandable steps and worksheets on every concept for your practice.

Learn solutions

###### Subscribe us

You can get the latest updates from us by following to our official page of Math Doubts in one of your favourite social media sites.