# How do you differentiate f(x)=xsqrt(abs(x-1) using the product rule?

Sep 21, 2016

Please see the explanation section below.

#### Explanation:

Because it involves the absolute value function, we need to first analyze the function.

Note that $\left\mid x - 1 \right\mid = \left\{\begin{matrix}x - 1 & \text{ if " & x-1 >= 0 \\ 1-x & " if } & x - 1 < 0\end{matrix}\right.$.

So we have

$f \left(x\right) = \left\{\begin{matrix}x \sqrt{x - 1} & \text{ if " & x > 1 \\ xsqrt(1-x) & " if } & x < 1\end{matrix}\right.$.

Now we can differentiate using $\frac{d}{\mathrm{dx}} \left(\sqrt{u}\right) = \frac{1}{2 \sqrt{u}} \frac{\mathrm{du}}{\mathrm{dx}}$.

$\frac{d}{\mathrm{dx}} \left(x \sqrt{x - 1}\right) = \left(1\right) \sqrt{x - 1} + x \frac{1}{2 \sqrt{x - 1}} \cdot 1$

$= \frac{2 x - 2 + x}{2 \sqrt{x - 1}} = \frac{3 x - 2}{2 \sqrt{x - 1}}$

and

$\frac{d}{\mathrm{dx}} \left(x \sqrt{1 - x}\right) = \left(1\right) \sqrt{1 - x} + x \frac{1}{2 \sqrt{1 - x}} \cdot \left(- 1\right)$

$= \frac{2 - 2 x - x}{2 \sqrt{1 - x}} = \frac{2 - 3 x}{2 \sqrt{1 - x}}$.

Putting these together, we have

$f ' \left(x\right) = \left\{\begin{matrix}\frac{3 x - 2}{2 \sqrt{x - 1}} & \text{ if " & x > 1 \\ (2-3x)/(2sqrt(1-x)) & " if } & x < 1\end{matrix}\right.$.

We can write the derivative of $\left\mid x \right\mid$ as $\left\{\begin{matrix}1 & \text{ if " x > 0 \\ -1 & " if } x < 0\end{matrix}\right.$

Or, we can use $\frac{\left\mid x \right\mid}{x}$ (or its reciprocal).

With this notation, we get

$\frac{d}{\mathrm{dx}} \left(\sqrt{\left\mid x - 1 \right\mid}\right) = \frac{1}{2 \sqrt{\left\mid x - 1 \right\mid}} \cdot \frac{d}{\mathrm{dx}} \left(\left\mid x - 1 \right\mid\right)$

$= \frac{1}{2 \sqrt{\left\mid x - 1 \right\mid}} \frac{\left\mid x - 1 \right\mid}{x - 1}$.

We can write $f ' \left(x\right)$ as

$f ' \left(x\right) = \frac{3 x - 2}{2 \sqrt{\left\mid x - 1 \right\mid}} \frac{\left\mid x - 1 \right\mid}{x - 1}$.