Prove that $x\,\int_a^x\,\frac{1}{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\,\text{d}s - \int_a^x\,\int_a^s\,f(t)\,\text{d}t\,\text{d}s$ is linear in $x$. 
Let $a$ be a positive real number and $f:[a,\infty)\to\mathbb{C}$ a continuous function.  Prove that the function $g:[a,\infty)\to\mathbb{R}$ defined by
  $$g(x):=x\,\int_a^x\,\frac{1}{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\,\text{d}s - \int_a^x\,\int_a^s\,f(t)\,\text{d}t\,\text{d}s\text{ for each }x\in[a,\infty)$$
  is a linear function.

I wonder if there is a solution involving only directly tackling the integrals (e.g., with integration by parts and/or with swapping the order of the integrals), without differentiating $g$.  My solution is to differentiate $g$ twice and show that $g''\equiv0$.  If $p$ and $q$ are constants such that $$g(x)=p(x-a)+q\text{ for all }x\geq a\,,$$ then it is not difficult to see that $q=0$.  It may be good to find out how the $p$ depends on $f$ and $a$.

 Spoiler: The constant $p$ does not depend on $f$ and $a$---it is just $0$.  Below is my solution.   Using the Leibniz Integral Rule, we obtain $$g'(x)=\int_a^x\,\frac{1}{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\,\text{d}s+\frac{1}{x}\,\int_a^x\,t\,f(t)\,\text{d}t-\int_a^x\,f(t)\,\text{d}t\,.$$  Thus, applying the Leibniz Integral Rule again yields $$g''(x)=\frac{1}{x^2}\,\int_a^x\,t\,f(t)\,\text{d}t-\frac{1}{x^2}\,\int_a^x\,t\,f(t)\,\text{d}t+f(x)-f(x)=0\,.$$  The result follows.  In fact, from this calculation, $g'(a)=0$.  Therefore, $p=0$ as well.  Hence, $g\equiv 0$.  Consequently, we indeed have that $$x\,\int_a^x\,\frac{1}{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\,\text{d}s = \int_a^x\,\int_a^s\,f(t)\,\text{d}t\,\text{d}s\text{ for every }x\in[a,\infty)\,.$$

 A: This equality can be obtained easily by integration by parts or switching the order of the two integrals. 
I will showcase the order switch.
We can draw the domain of integration on the s-t plane or purely algebraically conclude that the reversing the order changes the limits as follows:
$\int_{s=a}^xds\int^s_{t=a}dt=\int_{t=a}^xdt\int^x_{s=t}ds$
This allows us to perform one integral in every double integral:
$g(x)=x\int_{t=a}^xtf(t)dt\int^x_{s=t}d(-1/s)-\int_{t=a}^xdtf(t)\int^x_{s=t}ds=$
$x\int_{t=a}^xtf(t)(\frac{1}{t}-\frac{1}{x})dt-\int_{t=a}^xf(t)(x-t)dt=0$
and this concludes the proof.
A: Remark.  Here I want to elaborate how I came up with this problem.  That is, you can consider this answer as a synthetic solution.  
Write $D$ for the first derivative operator: $D\,h:=h'$.  Denote by $X$ the operator defined by $$(X\,h)(x):=x\,h(x)\,.$$  Finally, for every complex-valued function $\phi$, $\phi(X)$ is defined to be the operator $$\big(\phi(X)\,h\big)(x):=\phi(x)\,h(x)\,.$$  The problem arises from expressing the second-derivative operator $D^2$ in two different ways.
Note that $$D^2=\left(D+\frac{1}{X}\right)\,\left(D-\frac{1}{X}\right)\,.$$
All solutions $y$ to $$D^2\,y=f$$ are given by
$$y(x)=p_1x+q_1+\int_a^x\,\int_a^s\,f(t)\,\text{d}t\,\text{d}s\,,\tag{*}$$
where $p_1$ and $q_1$ are constant.
Now, we can solve $D^2\,y=f$ by writing this equation in the form
$$\left(D+\frac{1}{X}\right)\,\left(D-\frac{1}{X}\right)\,y=f\,.$$
Thus,
$$D\,\Biggl(X\,\left(D-\frac{1}{X}\right)\,y\Biggr)=X\,f\,.$$
Therefore, for some constant $q_2$, we get
$$\Biggl(X\,\left(D-\frac{1}{X}\right)\,y\Biggr)(x)=q_2+\int_a^x\,t\,f(t)\,\text{d}t\,.$$
Thus,
$$\Biggl(D\,\left(\frac{1}{X}\,y\right)\Biggr)(x)=\frac{q_2}{x^2}+\frac{1}{x^2}\,\int_a^x\,t\,f(t)\,\text{d}t\,.$$
This means
$$y(x)=x\,\Biggl(p_2+\int_a^x\,\left(\frac{q_2}{s^2}+\frac1{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\right)\,\text{d}s\Biggr)$$
for some constnat $p_2$.  Hence,
$$y(x)=p_2x+\frac{q_2(x-a)}{a}+x\,\int_a^x\,\frac{1}{s^2}\,\int_a^s\,t\,f(t)\,\text{d}t\,\text{d}s\,.\tag{#}$$
Now, for the same solution $y$ to $D^2y=f$, there are two expressions for $y$: (*) and (#).  Subtracting (*) from (#), we obtain
$$g(x)=p_1x+q_1-p_2x-\frac{q_2(x-a)}{a}=\left(p_1-p_2-\frac{q_2}{a}\right)\,x+\left(q_1+q_2\right)\,,$$
which is a linear polynomial.
