Question:medium

If the general solution of the differential equation \[ \cos^2x\frac{dy}{dx}+y=\tan x \] is \[ y=\tan x-1+Ce^{-\tan x} \] and it satisfies \[ y\left(\frac{\pi}{4}\right)=1, \] then \(C=\)

Show Hint

To find the arbitrary constant in a differential equation, substitute the given initial condition directly into the general solution.
Updated On: Jun 22, 2026
  • \(e\)
  • \(1\)
  • \(-1\)
  • \(\frac{1}{e}\)
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Write down the general solution and initial condition.
The general solution of $\cos^2 x \frac{dy}{dx} + y = \tan x$ is given as $y = \tan x - 1 + Ce^{-\tan x}$. We need to find $C$ using $y(\pi/4) = 1$.
Step 2: Substitute $x = \pi/4$ into the general solution.
$\tan(\pi/4) = 1$. So $y(\pi/4) = 1 - 1 + Ce^{-\tan(\pi/4)} = 0 + Ce^{-1} = \frac{C}{e}$.
Step 3: Apply the initial condition $y(\pi/4) = 1$.
$\frac{C}{e} = 1$, so $C = e$.
Step 4: Write the particular solution.
With $C = e$: $y = \tan x - 1 + e \cdot e^{-\tan x} = \tan x - 1 + e^{1 - \tan x}$.
Step 5: Verify the particular solution at $x = \pi/4$.
$y(\pi/4) = 1 - 1 + e^{1-1} = 0 + e^0 = 1$. This confirms the initial condition.
Step 6: State the final answer.
\[\boxed{C = e}\]
Was this answer helpful?
0