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

Evaluate the following integral: $\int_{1}^{4}{\left\{ \left| x-1 \right|+\left| x-2 \right|+\left| x-4 \right| \right\}dx}$.

Answer
VerifiedVerified
617.1k+ views
Hint: We will evaluate $\int_{1}^{4}{\left| x-1 \right|dx}$ then $\int_{1}^{4}{\left| x-2 \right|dx}$ and then $\int_{1}^{4}{\left| x-4 \right|dx}$ individually and finally we will add all three results to get the final value. Please note that whenever we open any modulus function $\left| a-b \right|$, then we get two results, one is positive and one is negative. When we open $\left| a-b \right|$, we get two values (a – b) for $a\ge 1$ and we get – (a – b) for a < 1.

Complete step-by-step answer:
It is given in the question that we have to evaluate this definite integral $\int_{1}^{4}{\left\{ \left| x-1 \right|+\left| x-2 \right|+\left| x-4 \right| \right\}dx}$. Now, we will divide the given definite integral into three parts. Let $\int_{1}^{4}{\left| x-1 \right|dx}$ be the 1st definite integral. Let $\int_{1}^{4}{\left| x-2 \right|dx}$ be the 2nd definite integral and let $\int_{1}^{4}{\left| x-4 \right|dx}$ be the 3rd definite integral.

Now, we are evaluating the 1st definite integral.
${{I}_{1}}=\int_{1}^{4}{\left| x-1 \right|dx}$

We know that whenever we open any modulus $\left| a-b \right|$ then we get two results one is positive and other is negative. So, from this when we open $\left| x-1 \right|$, we will get two values, one is $\left( x-1 \right)$ when $x\ge 1$and another is $-\left( x-1 \right)$ when $x<1$.
$\Rightarrow \left| x-1 \right|=\left\{ \begin{matrix}
   \left( x-1 \right)\ for\ x\ge 1 \\
   -\left( x-1 \right)\ for\ x<1 \\
\end{matrix} \right.$

So, we can write the integral $\int_{1}^{4}{\left| x-1 \right|dx}$ as,
$\begin{align}
  & {{I}_{1}}=\int_{1}^{4}{\left| x-1 \right|dx} \\
 & {{I}_{1}}=\int_{1}^{1}{-\left( x-1 \right)dx}+\int_{1}^{4}{\left( x-1 \right)dx} \\
\end{align}$

Here, $\int_{1}^{1}{-\left( x-1 \right)dx}$ and $\int_{1}^{4}{\left( x-1 \right)dx}$ can be written as $\int_{1}^{4}{\left( x-1 \right)dx}$ as $\int_{1}^{1}{-\left( x-1 \right)dx}$ is equal to 0.
$\Rightarrow {{I}_{1}}=\int_{1}^{4}{\left( x-1 \right)dx}$
${{I}_{1}}=\int_{1}^{4}{\left( x-1 \right)dx}$ can be also written as,
${{I}_{1}}=\int_{1}^{4}{\left( x \right)dx}-\int_{1}^{4}{1dx}$

We know that integration of is.

When we integrate ${{I}_{1}}$ we get,
${{I}_{1}}=\left[ \dfrac{{{x}^{2}}}{2} \right]_{1}^{4}-\left[ x \right]_{1}^{4}$

Putting 4 as upper limit and 1 as lower limit in ${{I}_{1}}$ we get,
$\begin{align}
  & {{I}_{1}}=\left[ \dfrac{{{\left( 4 \right)}^{2}}}{2}-\dfrac{{{\left( 1 \right)}^{2}}}{2} \right]-\left[ \left( 4-1 \right) \right] \\
 & {{I}_{1}}=\left[ \dfrac{16-1}{2} \right]-3 \\
 & {{I}_{1}}=\dfrac{15}{2}-3 \\
 & {{I}_{1}}=\dfrac{15-6}{2} \\
 & {{I}_{1}}=\dfrac{9}{2} \\
\end{align}$

Similarly, when we evaluate \[{{I}_{2}}=\int_{1}^{4}{\left| x-2 \right|dx}\] we get,
$\left| x-2 \right|=\left\{ \begin{matrix}
   \left( x-2 \right)\ for\ x\ge 2 \\
   -\left( x-2 \right)\ for\ x<2 \\
\end{matrix} \right.$
We can write \[{{I}_{2}}=\int_{1}^{4}{\left| x-2 \right|dx}\] as,
\[\begin{align}
  & {{I}_{2}}=\int_{1}^{2}{-\left( x-2 \right)dx+\int_{2}^{4}{\left( x-2 \right)}}dx \\
 & {{I}_{2}}=\int_{1}^{2}{+xdx\int_{1}^{2}{2dx}+\int_{2}^{4}{xdx-}}\int_{2}^{4}{2dx} \\
\end{align}\]

On integrating ${{I}_{2}}$ further we get,
${{I}_{2}}=-\left[ \dfrac{{{x}^{2}}}{2} \right]_{1}^{2}+2\left[ x \right]_{1}^{2}+\left[ \dfrac{{{x}^{2}}}{2} \right]_{2}^{4}\pm 2\left[ x \right]_{2}^{4}$

On putting the limits in ${{I}_{2}}$ we get,
$\begin{align}
  & {{I}_{2}}=-\left[ \dfrac{4-1}{2} \right]+2\left[ 2-1 \right]+\left[ \dfrac{16-4}{2} \right]-2\left[ 4-2 \right] \\
 & {{I}_{2}}=-\dfrac{3}{2}+2\left[ 1 \right]+\dfrac{12}{2}-2\left[ 2 \right] \\
 & {{I}_{2}}=-\dfrac{3}{2}+2+6-4 \\
 & {{I}_{2}}=-\dfrac{3}{2}+8-4 \\
 & {{I}_{2}}=-\dfrac{3}{2}+4 \\
 & {{I}_{2}}=\dfrac{-3+8}{2} \\
 & {{I}_{2}}=\dfrac{5}{2} \\
\end{align}$

Similarly when we evaluate $\int_{1}^{4}{\left| x-4 \right|dx}$we get,
$\left| x-4 \right|dx=\left\{ \begin{matrix}
   \left( x-4 \right)\ for\ x\ge 4 \\
   -\left( x-4 \right)\ for\ x<4 \\
\end{matrix} \right.$

We will consider only $-\left( x-4 \right)$ in our integration because $x<4$.
$\begin{align}
  & -\int_{1}^{4}{\left( x-4 \right)dx} \\
 & \Rightarrow -\int_{1}^{4}{\left( x \right)dx}+\int_{1}^{4}{\left( 4 \right)dx} \\
 & \Rightarrow -\left[ \dfrac{{{x}^{2}}}{2} \right]_{1}^{4}+\left[ 4x \right]_{1}^{4} \\
 & \Rightarrow -\left[ \dfrac{{{\left( 4 \right)}^{2}}}{2}-\dfrac{{{\left( 1 \right)}^{2}}}{2} \right]+\left[ 4\times 4-4\times 1 \right] \\
 & \Rightarrow -\left[ \dfrac{16}{2}-\dfrac{1}{2} \right]+\left[ 16-4 \right] \\
 & \Rightarrow -\left[ \dfrac{15}{2} \right]+\left[ 12 \right] \\
 & \Rightarrow \dfrac{-15}{2}+12 \\
 & \Rightarrow \dfrac{-15+24}{2} \\
 & \Rightarrow \dfrac{9}{2} \\
\end{align}$

Now, we have all three results of ${{I}_{1}},\ {{I}_{2}}\ and\ {{I}_{3}}$. So, we are ready to evaluate $\int_{1}^{4}{\left| x-1 \right|+\left| x-2 \right|+\left| x-4 \right|dx}$.
On adding the values of ${{I}_{1}}=\dfrac{9}{2}+{{I}_{2}}=\dfrac{5}{2}+{{I}_{3}}=\dfrac{9}{2}$, we get,
$\begin{align}
  & {{I}_{1}}+\ {{I}_{2}}+{{I}_{3}} \\
 & \Rightarrow \dfrac{9}{2}+\dfrac{5}{2}+\dfrac{9}{2} \\
 & \Rightarrow \dfrac{9+5+9}{2} \\
 & \Rightarrow \dfrac{23}{2} \\
\end{align}$

Thus, $\int_{1}^{4}{\left| x-1 \right|+\left| x-2 \right|+\left| x-4 \right|dx}=\dfrac{23}{2}$.

Note: We cannot open the modulus directly, we always get two results whenever we open it. One is positive and the other is negative. The concept is that modulus only gives the positive value. So, in order to make it positive we have to put a minus sign in one part of it. For example, in our question we have \[{{I}_{2}}=\int_{1}^{4}{\left| x-2 \right|dx}\].
When we open this modulus we get,
$\left| x-2 \right|=\left\{ \begin{matrix}
   \left( x-2 \right)\ for\ x\ge 2 \\
   -\left( x-2 \right)\ for\ x<2 \\
\end{matrix} \right.$
When $x\ge 2$ then automatically, we get a positive value but when the value of $x<2$ then we get a negative value and we know that modulus only gives the value. So, in order to make it positive we put minus signs before it.