Spivak, Ch. 18, Problem 45: Find all functions satisfying $f^{(n)}=f^{(n-1)}$. The following is a problem from Spivak's Calculus, Chapter 18



*Find all functions satisfying

(a) $f^{(n)}=f^{(n-1)}$

The solution manual says

(a) We have $f^{(n-1)}(x)=ce^x$, so
$$f(x)=a_0+a_1x+...+a_{n-2}x^{n-2}+ce^x$$

Why did he conclude that $f^{(n-1)}(x)$ must be $ce^{x}$? How do we know this represents all solutions?
I believe we can conclude that $ce^{x}$ is a solution to $f^{(n-1)}(x)=f^{(n)}(x)$ based on a previous problem (Problem 43, which I discuss below), but we never showed that this is the only solution.
Here are the problems that came before 45
Problem 42: if we can find a root $\alpha$ with multiplicity $r$ of the equation $\sum\limits_{i=1}^n a_ix^i$, then we also automatically have $r$ different roots of the differential equation $\sum\limits_{i=1}^n a_if^{(i)}(x)$. These roots are $x^ke^{\alpha k}$ for $0\leq k\leq r-1$. Also, any linear combination of these roots is a root, so we have infinite roots. A note at the end of the problem says that the set of these linear combinations represents all the possible solutions, though this is not proved here.
Problem 43: This problem I found very strange and not well specified but here goes. If a function $f$ satisfies $f''-f=0$ and $f(0)=f'(0)=0$ then it follows that $f=0$.
Now the proof of this is done in three steps (though I will only talk about two here).
First we show that $f^2-(f')^2=0$ follows from the initial assumptions.
Second, we show that if $f\neq 0$ in some interval $(a,b)$ then either $f(x)=ce^x$ or else $f(x)=ce^{-x}$ for all $x$ in $(a,b)$ and some constant $c$.
Here is the solution manual proof of this

Since $f(x)\neq 0$ for $x$ in $(a,b)$, it follows from part $(a)$ that
either $f'(x)=f(x)$ for all $x$ in $(a,b)$ or else $f'(x)=-f(x)$ for
all $x$ in $(a,b)$. Thus either $f(x)=ce^x$ or else $f(x)=ce^{-x}$ for
all $x$ in $(a,b)$.

I found this proof to be a bit strange, though probably only because it skips so many intermediate steps. Here is my proof of this result

$$(f')^2=f^2 \implies f=f' \text{ or } f=-f'$$
Case 1: $f'-f=0$
As per Problem 42, if we can find a solution to the polynomial $x-1=0$
then we will have a solution to $f'-f=0$. Since $1$ is the solution to
the polynomial, then $f(x)=e^x$ is a solution to the differential
equation. We can easily show that for any constant $c$, $f(x)=ce^x$ is
also a solution.
Case 2: $f'+f=0$. Analogous proof shows that $f(x)=e^{-x}$ is a
solution.

In any case, going back to problem 45a, $f^{(n)}=f^{(n-1)}$ means that $f(x)=ce^x$ is a solution for any constant $c$. But I don't see how we've shown that these are the only possible solutions.
 A: Let $g=f^{(n-1)}$. Then $g'=f^{(n)}=f^{(n-1)}=g$. Therefore, for some constant $c$,$$(\forall x\in\Bbb R):f^{(n-1)}(x)=g(x)=ce^x.$$
A: I'll answer your questions one by one. So, consider the differential equation:
$$f' = f$$
where we suppose that we are looking for solutions over an interval (this is very important, as I will explain in just a moment). Here's what he's doing. He's just implicitly "separating variables" as follows:
$$\frac{df}{dx} = f$$
$$\frac{df}{f} = dx$$
$$\int \frac{df}{f} = \int dx$$
$$\log(f(x)) = x+A$$
$$f(x) = ce^x$$
This is the heuristic he is using. Now, of course, none of this is really justified at this point BUT it's a useful heuristic that gets you your first shot at a solution to the ODE. So, he just uses it to get a solution that works. Then, the idea is to use the properties that you've proved about the exponential function previously to actually explicitly show that it is a solution. That's the motivation behind why a random exponential function appears.
We know that $f(x) = ce^x$ satisfies this equation. To show that these are all the solutions, let $g$ be a solution and define $h(x) = g(x) e^{-x}$. Then:
$$h'(x) = g'(x) e^{-x} - g(x)e^{-x} = (g'(x)-g(x))e^{-x} = 0$$
Since $h$ is continuously differentiable, it follows that $h$ is constant. So, we have that:
$$g(x) = ce^x$$
The reason why you need an interval here is this; if you were considering solutions over the union of two disjoint intervals, then $f$ could be zero on one interval and $f$ could be of the form $ce^x$ with $c \neq 0$ on the other interval. The fact that we've defined $f$ over an interval prevents that situation.
Now, for your specific situation, let $g = f^{(n-1)}$. Then, you have the differential equation $g' = g$. Using what I've showed above, you can conclude that $f^{(n-1)}(x) = ce^x$ and these are all the solutions.
Edit
Now, you were confused about Problem 43 so let me try to give you a nice way to think about that. We know that the family of functions $f(x) = ce^x$ satisfies the given ODE (without the additional conditions). Now, let $f$ be a solution of the differential equation and let $g(x) = f(x)e^{-x}$. Then:
$$g'(x) = f'(x)e^{-x}-f(x)e^{-x} = (f'(x)-f(x))e^{-x}$$
$$g''(x) = (f''(x)-f'(x))e^{-x}-(f'(x)-f(x))e^{-x}$$
$$g''(x) = (f''(x)-2f'(x)+f(x)) e^{-x} = 2(f(x)-f'(x))e^{-x}$$
Now, notice that $g''(x) = -2g'(x)$. By letting $h = g'$, we can actually conclude that:
$$g'(x) = c_1 e^{-2x}$$
From this, it follows that:
$$g(x) = c_1 e^{-2x} + c_2$$
But this implies that:
$$f(x) = c_1e^{-x} + c_2 e^x$$
Since $f(0) = 0$, we have that $c_1+c_2 = 0$. On the other hand, $f'(0) = -c_1+c_2 = 0$. So, $c_1 = c_2$. But both of these equations imply that $c_1 = c_2 = 0$. So, $f = 0$. This is a much more intuitive argument that is in line with the reasoning I used above. I'll leave it to you to manually verify that certain steps above are fine.
A: Define $g = \ln f^{(n-1)}$, we have $g'= 1.$ Then $f^{(n-1)} = ce^x $.
A: The differential equation $y'=y$ has $ce^x$ as a solution. The typical way to see that is by writing
$$\frac{dy}{dx} = y \implies \frac{dy}{y} = dx$$
and integrating LHS w.r.t $y$ and RHS w.r.t. $x$ we get our solution. However, if you are not familiar with basic ODEs this might seem a bit like black magic. An elementary way to see why this is indeed the solution is to multiply both sides with $e^{-x}$ to get
$$e^{-x}y(x)-e^{-x}y(x)=0 \implies (e^{-x}y(x))'=0$$
From the last relation you get that $y(x)=ce^x$. Do this for $y=f^{n-1}$ and then keep integrating to get the required result.
