Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store
seo-qna
SearchIcon
banner

Solve $\int_{0}^{\dfrac{\pi}{2}}|sin~x-cos~x\lvert.\text{d}x$
(A) $0$
(B) $2(\surd2-1)$
(C) $\surd2-1$
(D) $2(\surd2+1)$

Answer
VerifiedVerified
162.6k+ views
Hint: In the given question, we can observe that the function given does not have any positive values over its entire range. The value of this function is negative in the range of $0$ to $\dfrac{\pi}{4}$ and positive in the range of $\dfrac{\pi}{4}$ to $\dfrac{\pi}{2}$. So, the given function is broken into two parts, one from $0$ to $\dfrac{\pi}{4}$ and another from $\dfrac{\pi}{4}$ to $\dfrac{\pi}{2}$.

Formula used:

Complete step by step solution: The given integral is: I = $\int_{0}^{\dfrac{\pi}{2}}|sin~x-cos~x\lvert.\text{d}x$
Here the given function is f(x) = $\|sin~x-cos~x\lvert$ and the total range over which the integral is to be done is $0$ to $\dfrac{\pi}{2}$, with a lower limit of $0$ and an upper limit of $\dfrac{\pi}{2}$. We observe that the value of this function is negative in the range of $0$ to $\dfrac{\pi}{4}$ and positive in the range of $\dfrac{\pi}{4}$ to $\dfrac{\pi}{2}$.
So, the above integral can be written as I = $\int_{0}^{\dfrac{\pi}{4}}(sin~x-cos~x).\text{d}x+\int_{\dfrac{\pi}{4}}^{\dfrac{\pi}{2}}(sin~x-cos~x).\text{d}x$
As integration of $sin x = -cos x$ and the integration of $cos x = sin x$. So, the above integral becomes
I = $\left[-cos~x-sin~x\right]_{0}^{\dfrac{\pi}{4}}+\left[-cos~x-sin~x\right]_{\dfrac{\pi}{4}}^{\dfrac{\pi}{2}}$
We should remember the following values of sine and cosine functions at different angles: $sin 0 = 0$; sin $\dfrac{\pi}{4}$ = $\dfrac{1}{\surd2}$; sin $\dfrac{\pi}{2}$ = 1; $cos 0 = 1$; cos $\dfrac{\pi}{4}$ =$\dfrac{1}{\surd2}$; cos $\dfrac{\pi}{2}$ = 0.
Using these values to solve the question, we get
I = $(\dfrac{-1}{\surd2}-\dfrac{1}{\surd2}-(-1-0))+(-0-1-(\dfrac{-1}{\surd2}-\dfrac{1}{\surd2})$
I = $2(\surd2-1)$
Hence, $\int_{0}^{\dfrac{\pi}{2}}|sin~x-cos~x\lvert.\text{d}x$ = $2(\surd2-1)$

Thus, Option (B) is correct.

Note: The integration should be done carefully. We should keep in mind that it is a question of definite integration, so we should also substitute the upper and lower limits after integrating.