Is functional $\int_0^a \left( (u')^2 - u^2 \right) {\rm d} x$ convex? I posted a question here and I think I solved the point two of the question. Is my approach right?

Give that the functional
$$I[u] = \int_0^a \left( (u')^2 - u^2 \right) {\rm d} x$$
is homogenous, i.e., $I[\lambda u]= \lambda^2 I[u]$ for all $u \in X$ and $\lambda \in \mathbb{R}$, where
$$X = \left\{ u \in C^2([0,a]) \mid u(0)=u(a)=0 \right\}$$
I want to prove that $v$ is weak local minimizer iff $v$ is a global minimizer. I am planing to show that $I[u]$ is convex functional so the result be immediate.

My proof for convexity
Let $\lambda \in [0,1]$ and $u,v \in X$, then
\begin{align}
I[\lambda u + (1-\lambda)v]&= I[\lambda u] + I[(1-\lambda)v]\\
& = \lambda^2 I[u] + (1-\lambda)^2 I[v]\\
&\leq \lambda I[u] + (1-\lambda) I[v].
\end{align}
Thus, $I[u]$ is convex in $X$, the every local minimizer is global minimizer.
 A: If $a \in (0,\pi]$ then $I$ is convex.
To apply the Wirtinger's inequality, we need $u$ to have zero average over. Extend $u$ to $[-a,0]$ so that it is odd, then $\int_{-a}^a u(x) dx = 0$. I will assume that $u$ is defined on $[-a,a]$ subsequently and any Fourier coefficients are over this domain.
Let $\hat{u}_k$ denote the Fourier coefficients. Note that the maps $u \mapsto \hat{u}_k$ are (real) linear. Since the map $(x,y) \mapsto x^2+y^2$ is convex, we see that the maps $u \mapsto |\hat{u}_k|^2$ are convex. Note that $\hat{u}_0 = 0$.
Since $u \in C^2[0,a]$, we see that (the extended) $u,u' \in L^2[-a,a]$. We have $\hat{u'}_k = -i k {\pi \over a} \hat{u}_k$, and Parseval gives
${1 \over 2a}\int_{-a}^a u^2 = \sum_k |\hat{u}_k|^2$, ${1 \over 2a}\int_{-a}^a (u')^2 = \sum_k (k {\pi \over a})^2|\hat{u}_k|^2$.
In particular, $I(u) = a \sum_k ((k {\pi \over a})^2-1)|\hat{u}_k|^2 = a \sum_{|k| \ge 1} ((k {\pi \over a})^2-1)|\hat{u}_k|^2$.
Since the non negative sum of convex functions is convex, we see that $I$ is convex.
Now suppose $\pi < a$ and let $u(x) = \sin({\pi \over a} x)$, we can compute $\int u^2 = {a \over 2}$ and $\int (u')^2 = ({\pi \over a})^2 {a \over 2}$ to get
$I(u) = (({\pi \over a})^2-1) {a \over 2} < 0$.
Since $I(-u) = I(u) < 0$ and $I({1 \over 2} (u+(-u))) = 0$, we see that $I$ is not convex.
