Answer
The solution to the differential equation is:
\[
y = \tan x - 1 + C\, e^{-\tan x}
\]
Solution
To solve the differential equation:
\[
\cos^{2}x \frac{dy}{dx} + y = \tan x
\]
we can follow these steps:
### 1. Rewrite the Equation
First, let's rewrite the equation in the standard linear form:
\[
\frac{dy}{dx} + P(x) y = Q(x)
\]
Divide both sides by \(\cos^2 x\):
\[
\frac{dy}{dx} + \frac{1}{\cos^2 x} y = \frac{\tan x}{\cos^2 x}
\]
Here,
\[
P(x) = \frac{1}{\cos^2 x} = \sec^2 x \quad \text{and} \quad Q(x) = \frac{\tan x}{\cos^2 x} = \frac{\sin x}{\cos^3 x}
\]
### 2. Find the Integrating Factor
The integrating factor \(\mu(x)\) is given by:
\[
\mu(x) = e^{\int P(x) \, dx} = e^{\int \sec^2 x \, dx} = e^{\tan x}
\]
### 3. Multiply Through by the Integrating Factor
Multiply both sides of the differential equation by \(\mu(x)\):
\[
e^{\tan x} \frac{dy}{dx} + e^{\tan x} \sec^2 x y = e^{\tan x} \frac{\sin x}{\cos^3 x}
\]
This simplifies to:
\[
\frac{d}{dx}\left( y e^{\tan x} \right) = e^{\tan x} \frac{\sin x}{\cos^3 x}
\]
### 4. Integrate Both Sides
Integrate both sides with respect to \(x\):
\[
y e^{\tan x} = \int e^{\tan x} \frac{\sin x}{\cos^3 x} \, dx + C
\]
Let’s perform a substitution to evaluate the integral:
Let \( u = \tan x \), then \( du = \sec^2 x \, dx \).
Notice that:
\[
\frac{\sin x}{\cos^3 x} \, dx = \frac{\tan x}{\cos^2 x} \, dx = u \, du
\]
So the integral becomes:
\[
\int u e^{u} \, du = e^{u} (u - 1) + C = e^{\tan x} (\tan x - 1) + C
\]
### 5. Solve for \( y \)
Substitute back to solve for \( y \):
\[
y e^{\tan x} = e^{\tan x} (\tan x - 1) + C
\]
Divide both sides by \( e^{\tan x} \):
\[
y = \tan x - 1 + C e^{-\tan x}
\]
### Final Solution
\[
\boxed{y = \tan x - 1 + C\, e^{ -\,\tan x}}
\]
Reviewed and approved by the UpStudy tutoring team
Explain
Simplify this solution