$h(x) = \begin{cases} e^{-(1/x)} \sec{x} & \text{for} \quad x \in (0,\pi/2) \\ 0 & \text{for} \quad x \leq 0, \end{cases} $ is of class $C^{\infty}$.

How do I prove that $h:(-\pi/2,\pi/2) \rightarrow [0,\infty)$,

$$h(x) = \begin{cases} e^{-(1/x)} \sec{x} & \text{for} \quad x \in (0,\pi/2) \\ 0 & \text{for} \quad x \leq 0, \end{cases} $$

is $C^{\infty}$ on $(-\pi/2,\pi/2)$? By definition, a function is $C^{\infty}$ at a point if it is $C^k$ for all $ k \geq 0$ at that point.

Now I think it is plain that if $x \leq 0$ then $h(x)$ is $C^k$ for all $ k \geq 0$. This is because the only cause for concern is that the $kth$ derivative at $0$ may fail to be continuous, but using the Leibniz rule

$$h^{(k)} (0) = \sum_{k=0}^{n}f^{(k)}(0)g^{(n-k)}(0), \qquad\text{where } f(x) = e^{-1/x}\text{ and }g(x) = \sec{x},$$

we see that $h^{(k)} (0) = 0$ as $f^{(k)} (0) = 0$ for all $k \geq 0$.

Now for $x > 0$, it is plain that I can keep differentiating the function $h(x)$. So if I can differentiate it $k$ times then I know that its $k-1$ derivatives are all continuous. However is this sufficient to conclude that $h(x)$ is $C^{\infty}$ for every real $x$?

Thanks.


There is a consequence of Lagrange's Mean Value Theorem which states something like this:

If $a<c<b \in \Bbb{R}$ and $f: (a,b) \to \Bbb{R}$ by $$ f(x)=\begin{cases}g(x), & x \in (a,c] \\ h(x), & x \in (c,b)\end{cases},$$

continuous, with $g,h$ derivable functions on $(a,c)$ and $(c,b)$, respectively, then for $f$ to be derivable on $(a,b)$ it is enough to prove that $$ \lim_{x \to c, x<c} g'(x)=\lim_{x \to c,x>c} h'(x).$$

Now, I think this is enough to prove that your function is differentiable, since from what you've shown, the value of the derivative in $0$ on one side is equal to the derivative in $0$ in the other side, for all orders of derivation.