Finding the mean with absolute value This question is out of my field and topic that I am teaching myself now, but I was wondering how would you solve this problem if it had the absolute value of it.
My Question: 

$$f(x) = \begin{cases}
2/9(x-1),  & \text{for $1<x<4$} \\
0, & \text{elsewhere}  \\
\end{cases}
$$

I know what was given is $\mu=3$ and $\sigma=$ $\sqrt{.5}=.7071$

I wanted to find $E[|x-\mu|]$. 

My first thoughts would be $\int_1^4|x-\mu|f(x)dx.$ That is all I can think of because I did not learn about this one yet. I was just wondering out of curiousity how to solve this problem and seeing what it would look like. It seems like something good to know for later problems that are like it. 
$\int_1^4|x-\mu|f(x)dx$
$=\int_1^3 (2/9)(x-1)(3-x)dx+\int_3^4 (2/9)(x-1)(x-3)dx$
$2/9\int_1^3(-x^2+4x-3)dx+2/9\int_3^4(x^2-4x+3)dx$
$2/9\int_1^3(-x^3/3+2x^2-3x) + 2/9\int_3^4 (x^3/3-2x^2+3x)$
$(2/9)(-x^3/3+2x^2-3x)|_1^3 + (2/9)(x^3/3-2x^2+3x)|_3^4$
$8/27+8/27$
$16/27$

$\int_1^4|x-\mu|f(x)dx$
$=\int_1^3 (2/9)(x-1)(3-x)dx+\int_3^4 (2/9)(x-1)(x-3)dx$
$2/9\int_1^3(-x^2+4x-3)dx+2/9\int_3^4(x^2-4x+3)dx$
$2/9\int_1^3(-x^3/3+2x^2-3x) + 2/9\int_3^4 (x^3/3-2x^2+3x)$
$(2/9)(-x^3/3+2x^2-3x)|_1^3 + (2/9)(x^3/3-2x^2+3x)|_3^4$
$8/27+8/27$
$16/27$
