# Euler Lagrange equation in variational calculus for a sum of integrals

Let $$F, G: \mathbb{R}^3\rightarrow{}\mathbb{R}$$ be two continuously differentiable functions and let $$a\leq b \leq c$$. I want to know if there exists some known method to find a function that maximizes the functional $$J(P):=\int_a^b F(q,P(q),P'(q))dq+ \int_b^c G(q,P(q),P'(q))dq$$ between all the continuously differentiable functions $$P: \mathbb{R}\rightarrow{}\mathbb{R}$$ satisfying $$P(a)=0$$.

• Is it the case that $F(b,P(b),P'(b))=G(b,P(b),P'(b))$? If so and their derivatives also match at $b$ then you can define a piecwise $C^1$ function and use the Euler Lagrange equations. – Basel J. Jul 10 at 19:45
• Comment to the post (v1): Does $P$ satisfies any conditions at $b$ and/or $c$? – Qmechanic Jul 11 at 11:02
• Yes: I need $F(b,P(b),P'(b))=0=G(c,P(c),P'(c))$ – asd Jul 12 at 19:54
• Those seem not necessary. Other conditions? – Qmechanic Jul 13 at 8:20

They all use pseudospectral methods, which are great to feed a computer, but not very practical to solve by hand. I don't know any method to solve analytically. However, I am certain that if $$F$$ and $$G$$ are not identical, then the Hamiltonian will (most likely) have a jump discontinuity at q = b.