Do you lose solutions when differentiating to solve an integral equation? The question is more general but here's the problem that motivated it: I want to find all solutions to the integral equation
$$f(x) + \int_0^x (x-y)f(y)dy = x^3.$$
Differentiating twice with respect to x this yield the second order differential equation
$$f''(x) + f(x) = 6x.$$
The solution to this last equation is something of the form $f(x) = A \cos(x + \phi) + f_p$ where $f_p$ can be found by variation of parameters or other tools and $A, \phi$ are determined by initial values.
However, what I want to know is whether I'm accounting for all solutions here. Do I not "lose information" when differentiating the original equation? If so, how can I construct all solutions from the ones I just found?
 A: It's the other way around: when you differentiate both sides of an equation, you should be concerned about creating solutions. This is because $f'(x)=g'(x)$ only implies $f(x)=g(x)+c$ for some $c$. So any solution to the IE will satisfy the DE but not the other way around.
In effect the IE has the boundary conditions built into it in a way the DE does not. This isn't totally obvious, so let's walk through it in your example.
Substitute $x=0$ into the original IE to see $f(0)=0$. Differentiate once to get
$$f'(x)+\int_0^x f(y) dy=3x^2$$
and then substitute $x=0$ to get $f'(0)=0$. Thus the IE* implies the ODE IVP $f''(x)+f(x)=6x,f(0)=0,f'(0)=0$, which has a unique solution as you probably already know.
To see the ODE IVP implies the IE, you run the procedure in reverse:
$$\int_0^x f''(y) + f(y) dy = \int_0^x 6y dy \\
f'(x)-f'(0)+\int_0^x f(y) dy = 3x^2.$$
Use the initial condition:
$$f'(x)+\int_0^x f(y) dy = 3x^2.$$
Now you integrate again:
$$\int_0^x f'(y) dy + \int_0^x \int_0^y f(z) dz dy = \int_0^x 3y^2 dy \\
f(x)-f(0) + \int_0^x \int_0^y f(z) dz dy = x^3.$$
Use the other initial condition:
$$f(x)+\int_0^x \int_0^y f(z) dz dy = x^3.$$
This looks different from the original thing, but it is actually the same. One way to make it look the same is to use integration by parts together with the initial conditions on the outer integral of the second term. Another way is to interchange the order of integration; after the interchange you can simply do the inner $dy$ integral since $f(z)$ doesn't depend on $y$. The fact that these both work is a quite general thing, cf. https://en.wikipedia.org/wiki/Order_of_integration_(calculus)#Relation_to_integration_by_parts
* Technically you need the IE and a $C^2$ assumption to run this calculation. The shortcut way that I can think of to get this regularity assumption is to just assume it up front, check that the solution you get has the desired regularity (which it does) and then study the general uniqueness theory of the IE (which in this setting is the Fredholm alternative) to conclude that you didn't miss any irregular solutions.
A: Something that I think that high school math doesn't explain very clearly is the theory of extra/missing solutions. Let's say we have equations $(1)$ and $(2)$. If $(1)\rightarrow (2)$, that means $(\text{x satisfies (1)})\rightarrow(\text{x satisfies (2)})$, so every solution of $(1)$ will also be a solution of $(2)$. However, $(1)\rightarrow (2)$ does not guarantee that every solution of $(2)$ will be a solution of $(1)$. So when you have a chain of equivalent equations, every solution of the final equation will be a solution of the original equation. When you have a chain of implication, you can have extraneous solutions. To lose solutions, you have to have a situation where $(2)\rightarrow (1)$, i.e. your later equation is sufficient, but not necessary, for the initial equation to be true. For instance, if you go from $x^2=y^2$ to $x=y$, the first equation is a consequence of the second, but the second does not necessarily follow from the first.
In your case, you are differentiating. If equation $(1)$ is $y=f(x)$, and equation $(2)$ is $y'=f'(x)$, we have $(1)\rightarrow(2)$ (if two functions are equal, then their derivatives are equal as well), but we don't have $(2)\rightarrow(1)$ (that is, if two derivates are equal, that doesn't mean the original functions were equal). So, for instance, if you have $f(x) = x+1$ and take the derivative of both sides, you get $f'(x) = 1$, and $f(x)=x$ is a solution to the second equation, but not the first.
Differentiating does in fact lose information, but losing information means that you are getting more solutions, not fewer. The more information you have, the more possibilities you can eliminate. If you know $y=x+1$, there are some ordered pairs that you can eliminate (for instance, you that (1,0) is not a solution). If you also know that $2y=3x$, then you can eliminate more ordered pairs. Remember that equations don't rule solutions in, they only rule solutions out.
