Find the first-variational curve which corresponds to the functional
$$\int_{-1}^1 t^2 \dot{x}^2 dt$$
when $x(-1) = -1$ and $x(1) = 1$.
Here is what I did:
\begin{align} \delta J(x)(h) &= \frac{d}{d \epsilon} J(x + \epsilon h)|_{\epsilon = 0}\\ &= \frac{d}{d \epsilon} \left[\int_{-1}^1 t^2(\dot{x} + \epsilon \dot{h})^2 dt \right]|_{\epsilon = 0}\\ &= \frac{d}{d \epsilon} \left[\int_{-1}^1 t^2(\dot{x}^2 + 2 \dot{x} \dot{h} \epsilon + \dot{h}^2 \epsilon^2) dt \right]|_{\epsilon = 0}\\ &= \frac{d}{d \epsilon} \left[\int_{-1}^1 (t^2\dot{x}^2 + 2t^2 \dot{x} \dot{h} \epsilon + t^2\dot{h}^2 \epsilon^2) dt \right]|_{\epsilon = 0}\\ &= \int_{-1}^1 \frac{d}{d \epsilon} (t^2\dot{x}^2 + 2t^2 \dot{x} \dot{h} \epsilon + t^2\dot{h}^2 \epsilon^2) dt |_{\epsilon = 0}\\ &= \int_{-1}^1 (2t^2 \dot{x} \dot{h} + 2t^2\dot{h}^2 \epsilon) dt |_{\epsilon = 0}\\ &= \int_{-1}^1 (2t^2 \dot{x} \dot{h}) dt\\ &= 2\dot{x} \dot{h} \left[\frac{1}{3}t^3 \right]|_{t = -1}^{t = 1}\\ &= 2\dot{x} \dot{h} \left[\frac{1}{3} + \frac{1}{3} \right]\\ &= 2\dot{x} \dot{h} \left[\frac{2}{3}\right]\\ &= \frac{4}{3} \dot{x} \dot{h} \end{align}
I'm not sure if I did this correctly. If I have done this correctly, then do I just need to integrate my result in order to use my given conditions of $x(-1) = -1$ and $x(1) = 1$?
You are wrong here:
$$ \int_{-1}^1 2t^2 \dot x \dot h dt = 2 \dot x \dot h \bigg[ \frac{1}{3} t^3 \bigg]_{t=-1}^{t=1}$$
Note $x(t)$, $h(t)$ are functions, you cannot pull out them from the integral. Instead, you do integration by part:
$$ \int_{-1}^1 2t^2 \dot x \dot h dt = -\int_{-1}^1 (2t^2 \dot x)' hdt$$
(Assuming $h$ is zero at the boundary).