© All Rights reserved @ LearnWithDash
Step-by-Step Solution
Step 1: Identify the Differential Equation
The slope of the tangent to the curve $y = f(x)$ is given by:
$$
\frac{dy}{dx} = 2 \tan x \bigl(\cos x - y\bigr).
$$
This can be rearranged as:
$$
\frac{dy}{dx} + 2 \tan x \, y = 2 \sin x.
$$
We must solve this differential equation subject to the condition that the curve passes through
$\left(\tfrac{\pi}{4}, 0\right)$.
Step 2: Find the Integrating Factor
The general form of a first-order linear differential equation is
$$
\frac{dy}{dx} + P(x)\,y = Q(x).
$$
Here, $P(x) = 2 \tan x$ and $Q(x) = 2 \sin x$. The integrating factor (I.F.) is given by
$$
\text{I.F.} = e^{\displaystyle \int P(x)\,dx}
= e^{\displaystyle \int 2 \tan x \, dx}.
$$
We know
$$
\int \tan x \, dx = -\ln \bigl|\cos x\bigr|,
$$
so
$$
\int 2 \tan x \, dx = 2 \,\bigl(-\ln |\cos x|\bigr)
= -2 \ln |\cos x|.
$$
Therefore,
$$
\text{I.F.} = e^{-2 \ln |\cos x|} = \frac{1}{(\cos x)^2} = \sec^2 x.
$$
Step 3: Solve the Differential Equation
Multiply both sides of
$$
\frac{dy}{dx} + 2 \tan x \, y = 2 \sin x
$$
by the integrating factor $\sec^2 x$:
$$
\sec^2 x \cdot \frac{dy}{dx}
+ 2 \tan x \, \sec^2 x \, y
= 2 \sin x \, \sec^2 x.
$$
The left-hand side becomes the derivative of $y \sec^2 x$, i.e.
$$
\frac{d}{dx}\bigl(y \sec^2 x\bigr)
= 2 \sin x \, \sec^2 x.
$$
Hence,
$$
y \sec^2 x = \int 2 \sin x \, \sec^2 x\; dx.
$$
We compute the integral:
$$
\int \sin x \, \sec^2 x \, dx.
$$
Let $u = \cos x \implies du = -\sin x \, dx$,
so $\sin x \, dx = -du$. Therefore,
$$
\int \sin x \, \sec^2 x \, dx
= \int \sec^2 x \, (\sin x \, dx)
= -\int \sec^2 x \, du.
$$
Since $\sec x = \frac{1}{\cos x}$, we have $\sec^2 x = \frac{1}{(\cos x)^2} = \frac{1}{u^2}.$ Thus,
$$
-\int \frac{1}{u^2}\, du
= -\Bigl(-\frac{1}{u}\Bigr)
= \frac{1}{u}
= \frac{1}{\cos x}
= \sec x.
$$
Multiplying by 2 yields $\int 2 \sin x \sec^2 x \,dx = 2 \sec x$. Therefore,
$$
y \sec^2 x = 2 \sec x + C,
$$
where $C$ is the constant of integration.
Step 4: Apply the Initial Condition
The curve passes through the point $\left(\tfrac{\pi}{4},0\right)$. Substituting $x = \tfrac{\pi}{4}$ and $y=0$,
$$
0 \cdot \sec^2 \Bigl(\tfrac{\pi}{4}\Bigr)
= 2 \sec \Bigl(\tfrac{\pi}{4}\Bigr) + C.
$$
We know $\sec \bigl(\tfrac{\pi}{4}\bigr) = \sqrt{2}$. Hence,
$$
0 = 2\sqrt{2} + C
\quad \Longrightarrow \quad
C = -2\sqrt{2}.
$$
Thus the particular solution becomes
$$
y \sec^2 x = 2 \sec x - 2\sqrt{2},
$$
and therefore,
$$
y = 2 \cos x - 2\sqrt{2} \cos^2 x.
$$
Step 5: Evaluate the Required Integral $\displaystyle \int_{0}^{\frac{\pi}{2}} y \, dx$
We need to find
$$
\int_{0}^{\frac{\pi}{2}} y \, dx
= \int_{0}^{\frac{\pi}{2}} \Bigl(2 \cos x - 2\sqrt{2} \cos^2 x\Bigr)\, dx.
$$
Separate the integral:
$$
= 2 \int_{0}^{\frac{\pi}{2}} \cos x \, dx
\;-\; 2\sqrt{2} \int_{0}^{\frac{\pi}{2}} \cos^2 x \, dx.
$$
Integrate $2 \cos x$ from 0 to $\tfrac{\pi}{2}$:
$$
2 \int_{0}^{\frac{\pi}{2}} \cos x \, dx
= 2 \Bigl[\sin x\Bigr]_{0}^{\frac{\pi}{2}}
= 2 \bigl(\sin \tfrac{\pi}{2} - \sin 0\bigr)
= 2 \bigl(1 - 0\bigr)
= 2.
$$
Integrate $2\sqrt{2} \cos^2 x$ from 0 to $\tfrac{\pi}{2}$:
$$
\int_{0}^{\frac{\pi}{2}} \cos^2 x \, dx
= \int_{0}^{\frac{\pi}{2}} \frac{1 + \cos(2x)}{2} \, dx
= \frac{1}{2} \int_{0}^{\frac{\pi}{2}} 1 \, dx
+ \frac{1}{2} \int_{0}^{\frac{\pi}{2}} \cos(2x) \, dx.
$$
This is a standard result:
$$
\int_{0}^{\frac{\pi}{2}} \cos^2 x \, dx = \frac{\pi}{4}.
$$
Hence,
$$
2\sqrt{2} \int_{0}^{\frac{\pi}{2}} \cos^2 x \, dx
= 2\sqrt{2} \cdot \frac{\pi}{4}
= \frac{\pi \sqrt{2}}{2}.
$$
Putting them together:
$$
\int_{0}^{\frac{\pi}{2}} \Bigl(2 \cos x - 2\sqrt{2} \cos^2 x\Bigr)\, dx
= 2 - \frac{\pi \sqrt{2}}{2}
= 2 - \frac{\pi}{\sqrt{2}}.
$$
Final Answer
$$
\int_{0}^{\frac{\pi}{2}} y \, dx = 2 - \frac{\pi}{\sqrt{2}}.
$$