A first order non-homogeneous initial value problem Does $\frac{\text{d}y}{\text{d}x}=-y+\sin(x^2)$ has a unique and well defined solution in $y\in[0,\infty)$ for any $y(0)\in\mathbb{R}$? For a unique solution to exists, do we need $\sin(x^2)$ to be locally Lebesgue integrable on $[0,\infty)$?
 A: Hint : This is a classic example of elaborating an existence and uniqueness case by Piccard's or Peano's Theorem and via Lipschitz continuity. I'll provide a general elaboration down below. 

Let the differential equation problem of the specific problem of an initial value, be : 
$$y' = -y + \sin(x^2), \quad y(x_0)=y_0 $$
Consider the function : 
$$f(x,y) = -y + \sin(x^2)$$
Then, it's obvious that $D_f = \mathbb R^2$ and that the function $f$ is continuous over $\mathbb R^2$. 
Then, following from Piccard's Theorem of Existence (or Peano's respectively), the given initial value problem has a solution because $f$ is continuous, or in other words, $f$ is continuous on an interval of the form : 
$$D = \{ (x,y) \in \mathbb R^2 : |x-x_0|<a, \space |y-y_0| < b\}, \space \text{where} \space a,b>0$$
This means that a solution for the IVP exists in $D$ and is well defined in it. 
To proceed about the uniqueness, you need to show that $f_y$ is bounded, or in other words $f$ is Lipschitz continuous.
The derivative of $f$ with respect to $y$ is :
$$f_y = \frac{\partial (-y + \sin(x^2))}{\partial y} -1$$
which clearly yields a bounded/surrounded case, as for :
$$\lim_{y\to \pm \infty} f_y=-1$$
This means that the solution is unique.
Note 1 : Manipulating the case for $x_0 = 0$ and a specific initial value will yield more specific results, as for the existence and uniqueness in $[0,\infty)$.
Note 2: Take into account that the existence and the uniqueness of a solution to a given IVP does not necessarily mean that one can find the solution in terms of standard functions.
A: In fact it's much easier than using general theorems about existence annd uniqueness. In a first-semester DE course one learns a method of solving first-order linear equations, and, unlike a lot of things one learns in that course, the algorithm essentially contains a proof that it's correct.


If $g$ is continuous then $y'+y=g$, $y(0)=a$ has a unique solution.


Proof: Since $e^t\ne0$, $y'+y=g$ is equivalent to $$e^{t}y'+e^ty=e^tg(t),$$or $$(e^tg(t))'=e^tg(t).$$
But since $e^tg(t)$ is continuous, elementary calculus show there is a unique function $f$ such that $$f'(t)=e^tg(t),\quad f(0)=a.$$
(Existence: Let $f(t)=a+\int_0^t e^sg(s)\,ds$. Uniqueness: If $f_1$ and $f_2$ are two solutions then $(f_a-f_2)'=0$, so $f_1-f_2$ is constant. But $f_1(0)-f_2(0)=0$.)
