Derivative with respect to a function under integral in calculus of variations (partial derivation) I am solving a variational calculus problem, in which the functional is in the form of:
$$
J[p(t),\lambda]=\int_a^b\left(t^2\cdot p^2(t)+t^2\int_0^t p^3(\tau)\cdot g(\tau)d\tau -{\lambda}\cdot{p(t)}\right)dt
$$
So the Lagrangian function in in the following form (Lagrangian itself includes an integral!!)
$$
  L = t^2\cdot p^2(t)+t^2\int_0^t p^3(\tau)\cdot g(\tau)d\tau -{\lambda}\cdot{p(t)}
$$
Now I'm confused, how can I use Euler-Lagrange equation for solving this problem. In other words how can I integrate $\int_0^t p^3(\tau)\cdot g(\tau)d\tau$ with respect to $p(t)$? I think a partial derivative method can be used, but I can't find the right answer.
Thanks in advance
 A: Hints: 


*

*The standard formula for Euler-Lagrange (EL) equation does not apply to double integrals. But luckily we can rewrite OP's functional $J[p]$ as a single integral with the help of Fubini's theorem.

*In this answer, we will assume that $0<a<b$, and leave it for the reader to work out other cases. In more details, OP's functional reads
$$J[p]~:=~J_1[p]+J_2[p],$$
$$ J_1[p]~:=~\int_0^b\! \mathrm{d}t~L_1,\qquad L_1~:=~\theta(t\!-\!a)  \left[ t^2 p(t )^2 -\lambda p(t )\right],$$ 
$$J_2[p]~:=~ \int_a^b\! \mathrm{d}t_1  \int_0^{t_1}\! \mathrm{d}t_2 ~t_1^2~g(t_2)~p(t_2)^3 ~\stackrel{\text{Fubini's Thm}}{=}~\int_0^b\! \mathrm{d}t_2  \int_{\max(t_2,a)}^b\! \mathrm{d}t_1 ~t_1^2~g(t_2)~p(t_2)^3 $$
$$~=~\int_0^b\! \mathrm{d}t~L_2, \qquad L_2~:=~\frac{1}{3}\left[b^3\!-\!\max(t,a)^3\right]g(t)~p(t)^3.$$
Therefore OP's functional becomes a single integral
$$J[p]~=~\int_0^b\! \mathrm{d}t~L,\qquad  L~:=~L_1+L_2.$$
EL equation
$$0~=~ \frac{\partial L}{\partial p(t)}~=~\theta(t\!-\!a) \left[ 2t^2 p(t )  -\lambda  \right]+\left[b^3\!-\!\max(t,a)^3\right]g(t)~p(t)^2$$
becomes a quadratic equation in $p(t)$.
