# What is the general solution of the differential equation ?  sec^2y dy/dx+tany=x^3

Oct 18, 2017

$y = \arctan \left({x}^{3} - 3 {x}^{2} + 6 x - 6 + c {e}^{- x}\right)$

#### Explanation:

We have:

${\sec}^{2} y \frac{\mathrm{dy}}{\mathrm{dx}} + \tan y = {x}^{3}$ ..... [A]

Let us try a substitution:

Let $\tan y = \theta \implies {\sec}^{2} y \frac{\mathrm{dy}}{d \theta} = 1$

And by the chain rule, we have:

${\sec}^{2} y \frac{\mathrm{dy}}{d \theta} \frac{d \theta}{\mathrm{dx}} = \frac{d \theta}{\mathrm{dx}} \implies {\sec}^{2} y \frac{\mathrm{dy}}{\mathrm{dx}} = \frac{d \theta}{\mathrm{dx}}$

Substituting into the DE [A] we get:

$\frac{d \theta}{\mathrm{dx}} + \theta = {x}^{3}$ ..... [B]

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

Then the integrating factor is given by;

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = \exp \left(\int \setminus 1 \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(1 x\right)$
$\setminus \setminus = {e}^{x}$

And if we multiply the DE [B] by this Integrating Factor, $I$, we will have a perfect product differential:

${e}^{x} \frac{d \theta}{\mathrm{dx}} + {e}^{x} \theta = {x}^{3} {e}^{x}$
$\therefore \frac{d}{\mathrm{dx}} \left({e}^{x} \setminus \theta\right) = {x}^{3} {e}^{x}$

Which is now a separable DE, so we can separate the variables to get:

${e}^{x} \setminus \theta = \int \setminus {x}^{3} {e}^{x} \setminus \mathrm{dx}$ ..... [C]

For the RHS integral we could apply Integration By Parts three times. Each application will reduce the the power of the cubic whilst leaving the exponential unchanged. Given this we know that the solution to the integral will be of the form:

$\int \setminus {x}^{3} {e}^{x} \setminus \mathrm{dx} = \left(A {x}^{3} + B {x}^{2} + C x + D\right) {e}^{x}$

Differentiation the above wrt $x$ and applying the product rule we get:

${x}^{3} {e}^{x} \equiv \left(A {x}^{3} + B {x}^{2} + C x + D\right) {e}^{x} + \left(3 A {x}^{2} + 2 B x + C\right) {e}^{x}$

Equating coefficients we get:

$C o e f f \left({x}^{3}\right) : 1 = A$
$C o e f f \left({x}^{2}\right) : 0 = B + 3 A \implies B = - 3$
$C o e f f \left({x}^{1}\right) : 0 = C + 2 B \implies C = 6$
$C o e f f \left({x}^{0}\right) : 0 = D + C \implies D = - 6$

Thus we have:

$\int \setminus {x}^{3} {e}^{x} \setminus \mathrm{dx} = \left({x}^{3} - 3 {x}^{2} + 6 x - 6\right) {e}^{x}$

Using this result we can now integrate [C] to get:

${e}^{x} \setminus \theta = \left({x}^{3} - 3 {x}^{2} + 6 x - 6\right) {e}^{x} + c$
$\therefore \theta = {x}^{3} - 3 {x}^{2} + 6 x - 6 + c {e}^{- x}$

Then if we restore our earlier substitution, we get:

$\tan y = {x}^{3} - 3 {x}^{2} + 6 x - 6 + c {e}^{- x}$
$\therefore y = \arctan \left({x}^{3} - 3 {x}^{2} + 6 x - 6 + c {e}^{- x}\right)$