I'm given a wave function (pg. 13 Griffith's 2nd ed, #1.7)
$\Psi(x,0) = Ax/a \qquad if \qquad 0\le x \le a $
$\Psi(x,0) = A(b-x)/(b-a) \quad if \quad a\le x \le b $
$\Psi(x,0) = 0 \quad if \quad b\lt x $
Now, I've normalized $ \Psi $ and can find the probability of any given area, but I'm not sure how to approach finding $ \langle x \rangle $ when the function is given piecemeal like this.
It would simply be \begin{align} \langle x\rangle &=\int_0^b dx\,x\vert\Psi(x,0)\vert^2\, ,\\ &=\int_0^a dx\, x\vert\Psi(x,0)\vert^2 + \int_a^b dx\, x\vert\Psi(x,0)\vert^2 \end{align} with the appropriate piece of $\Psi(x,0)$ on the appropriate interval. The fact that it's piecewise isn't an issue.