The general solution of the differential equation:
$$
\cos^2 x \cdot \frac{dy}{dx} + y = \tan x
$$
is
$$
y = \tan x - 1 + C e^{-\tan x}
$$
If this solution satisfies $ y\left(\frac{\pi}{4}\right) = 1 $, then find $ C $.
Show Hint
When verifying a solution with an initial condition, plug the value into the general solution and solve for the constant.
Given:
\[
y = \tan x - 1 + C e^{-\tan x}
\quad \text{and} \quad y\left(\frac{\pi}{4}\right) = 1
\]
At \( x = \frac{\pi}{4} \Rightarrow \tan\left(\frac{\pi}{4}\right) = 1 \)
Substitute into the solution:
\[
1 = 1 - 1 + C e^{-1}
\Rightarrow 1 = C e^{-1}
\Rightarrow C = e
\]