<s>[INST] Silly question: Why is $\sqrt{(9x^2)} $ not $3x$? I had to find the derivative of $f(x) = \sqrt{(9x^2)}$. I applied chain rule with the following steps.
Let $f(x)$ be $\sqrt{x}$ and $g(x)$ be $9x^2$ 
$$ \begin{align} &f'(g(x)) \times g'(x)  \\
 & = \frac{1}{2\sqrt{(9x^2)}} \times 18x \\
 & = \frac{18x}{2\sqrt{9x^2}} \\
 & = \frac{9x}{3\sqrt{x^2}}\\
 & = \frac{9x}{3\sqrt{x^2}} \\
 & = \frac{3x}{\sqrt{x^2}} \end{align}$$
I got the answer but I don't understand why the last bit doesn't simplify to $3$ because $\sqrt{x^2}$ is $x$ and if it does then why does the back of my textbook and W|A say that it is not?
EDIT: 
Okay, so from what I understand, it should be actually $3|x|$. If for example, I had $\sqrt{4x^2}$, I will have $2|x|$, if my understanding is correct.
 [/INST] Remember that $\sqrt{x^2}$ is the positive number whose square is $x^2$ (this is the definition of the square root sign). If $x$ is positive, then that number is $x$, otherwise, it is $-x$. For example, $\sqrt{(-3)^2} = \sqrt{9} = 3$, not $-3$. You can always say that $\sqrt{x^2} = \left| x \right|$.
</s>