Maclaurin's series for $\cos{\sqrt{x}}$ Why does Maclaurin's series for this function exist:
$$y=\cos{\sqrt{x}}$$
even though the second derivative of the function at $x=0$ is undefined?
I know that you can use the standard series of $\cos{x}$ and replacing $x$ with $\sqrt{x}$ to find its Maclaurin's expansion, but why can't I use the standard Maclaurin's theorem to expand the function as a power series?
 A: Are you sure the second derivative is not defined at $x=0$? The first derivative is
$$ f'(x) = \begin{cases} -\frac{\sin{\sqrt{x}}}{2\sqrt{x}} & x > 0 \\ -\frac{1}{2} & x = 0 \end{cases}. $$
The second derivative at zero is
$$ f''(0) = \lim_{h \to 0} \frac{1}{h} \left( \frac{1}{2} - \frac{\sin{\sqrt{h}}}{2\sqrt{h}} \right) = \lim_{h \to 0} \frac{\sqrt{h}-\sin{\sqrt{h}}}{2h^{3/2}} = \frac{1}{12}. $$
Just because $g'(a)$ does not exist, doesn't mean that $(f \circ g)'(a)$ doesn't exist: the chain rule may only work if $g'(a)$ is defined, but the derivative is calculated as the limit of the quotient $(f(g(a+h))-f(g(a)))/h$, so, as here, can exist even if $g'(a)$ does not.
A: It leads to the same results. Call 
$$
f(x) = \cos\sqrt{x}
$$

  
*
  
*$f'(0)$
  

$$
f'(x) = -\frac{\sin\sqrt{x}}{2\sqrt{x}}
$$
So that
$$
\lim_{x\to 0 }f'(x) = -\frac{1}{2}
$$
where I used the well known limit $\lim_{t\to 0}\sin t/t = 1$.

  
*
  
*$f''(0)$
  

$$
f''(x) = \frac{1}{4 x}\left(-\cos \sqrt{x}  + \frac{\sin \sqrt{x}}{\sqrt{x}}\right)
$$
And the limit is 
$$
\lim_{x\to0} f''(x) = \frac{1}{12}
$$
So the first two terms lead to
$$
\cos\sqrt{x} = 1 - \frac{x}{2} + \frac{x^2}{24} + \cdots\tag{1}
$$
For comparison, this is the expansion for $\cos (t)$
$$
\cos t = 1 -\frac{t^2}{2} + \frac{t^4}{24} + \cdots \tag{2}
$$
You can obtain (1) from (2) just by replacing $t = \sqrt{x}$
A: You seem to misinterpret the nature of the chain rule $$(f\circ g)'(x) = f'(g(x))g'(x).$$ What it means is that if $g$ is differentiable at $x_0$ and $f$ is differentiable at $g(x_0)$, then $f\circ g$ is differentiable at $x_0$ and the derivative is given by the above formula.
Basically, a crude way to say it is "conditions xyz are true $\implies$ formula works" and its contrapositive is "formula doesn't work $\implies$ conditions xyz are not true". The contrapositive of the chain rule doesn't say that composition isn't differentiable if the formula doesn't work.
For example, $(\cos\sqrt x)' = -\frac{\sin\sqrt x}{2\sqrt x}$ for $x\neq 0$ by the chain rule. As you say, it is not defined at $0$, so the chain rule doesn't work at $0$ and from that we can conclude that either $\cos$ or $\sqrt{\,\cdot\,}$ is not differentiable at $0$. And take a look at that, indeed we know that $\sqrt{\,\cdot\,}$ is not differentiable at $0$.
However, that still doesn't mean that $\cos\sqrt x$ isn't differentiable at $0$. We can check the definition of the derivative, in this case we must verify that the limit $$\lim_{x\to 0}\frac{\cos\sqrt x - 1}{x}$$ exists. It does and is equal to $-\frac 12$. Not only that, $$\lim_{x\to 0}\frac{-\sin\sqrt x}{2\sqrt x} = -\frac 12$$ as well, so not only is $\cos\sqrt x$ differentiable everywhere, its first derivative is continuous.
Checking for the second and higher derivatives leads to similar conclusion.
