Evaluate the integral
\[ \int |x| \; dx \]
Rewrite as
\[ \int |x| \; dx = \int 1 \cdot |x| \; dx \quad (I) \]
Note that \( |x| = \sqrt {x^2} \) and hence \( \dfrac{d(|x|)}{dx} = \dfrac{x}{\sqrt {x^2}} = \dfrac{x}{|x|} \quad (II) \)
Apply the integration by parts: \( \displaystyle \int u' v \; dx = u v - \int u v' \; dx \) to the integral on the right side of (I) above.
Let \( u' = 1 \) , \( v = |x| \) which gives \( u = x \) and \( v' = \dfrac{x}{|x|} \) , see (II) above.
We substitute all the above in the formula of the integration by parts given above.
\[ = x |x| - \int x \dfrac{x}{|x|} dx \quad (III)\]
Multiply the numerator and denominator of the integrand \( x \dfrac{x}{|x|} \) in the above integral
\[ x \dfrac{x}{|x|} = x \dfrac{x}{|x|} \dfrac{|x|}{|x|} \]
Simplify noting that \( |x| |x| = x^2 \)
\[ = |x| \]
We now substitute the integrand \( x \dfrac{x}{|x|} \) in (III) by \( |x| \) and write
\[ \int |x| dx = x |x| - \int |x| dx \]
Add \( \displaystyle \int |x| dx \) to both sides
\[ \int |x| dx + \int |x| dx = x |x| - \int |x| dx + \int |x| dx \]
Simplify by grouping
\[ 2 \int |x| \; dx = x |x| \]
The final answer is given by
\[ \boxed {\int |x| \; dx = \dfrac{1}{2} x |x| } \]