<s>[INST] Chain rule with triple composition We are supposed to apply the chain rule on the following function $f$:
$$
f(x) = \sqrt{x+\sqrt{2x+\sqrt{3x}}}  
$$
I assumed we could rewrite this as $$ f(x) = g(h(j(x))) $$
However, I was not sure how to define the functions $$g(x), h(x), j(x) $$
Any help would be appreciated.
 [/INST] 1) $j(x) = 2x + \sqrt{3x}$
$j'(x) = 2 + \frac{\sqrt{3}}{2\sqrt{x}}$
2) $h(x) = x + \sqrt{2x + \sqrt{3x}} = x + \sqrt{j(x)}$ 
$h'(x) = 1 + \frac{1}{2*\sqrt{j(x)}} * j'(x)$ $=1 + \frac{1}{2*\sqrt{2x + \sqrt{3x}}} * (2 + \frac{\sqrt{3}}{2\sqrt{x}})$
3) $g(x) = \sqrt{x + \sqrt{2x + \sqrt{3x}}} = \sqrt{h(x)}$
$g'(x) = \frac{1}{2*\sqrt{h(x)}} * h'(x)$ $=\frac{1}{2*\sqrt{x + \sqrt{2x + \sqrt{3x}}}} * (1 + \frac{1}{2*\sqrt{2x + \sqrt{3x}}} * (2 + \frac{\sqrt{3}}{2\sqrt{x}}))$
</s>