Verify the solution for u'' = -(Ω^2)u + (Ω^2)a.  Calculated solution, summing specific and  homogenenous solutions:

Clear[ u, omega, a, u0 ]
$Assumptions = a ∈ Reals &&  omega > 0 && a ∈ Reals && u0 ∈ Reals ;

u[t_] = 2  a Sin[ omega t /2]^2 + u0 Cos[ omega t ] ;
Row[{"u(t) = ", u[t] /. omega -> Ω /. u0 -> (Subscript[u, 0]) // TraditionalForm }]

Check against the ODE

Clear[check]
check = u''[t] + omega^2 u[t] - omega^2 a  ;
check /. omega -> Ω /. u0 -> (Subscript[u, 0]) // TraditionalForm
check // Simplify

Compute the average over one period T = 2 π/Ω

Clear[i]
i = Module[{p},
p = 2 Pi/omega ;
(1/p) Integrate[ u[t], {t, 0, p}]
]
Integrate[ 2 Sin[ 2 Pi s/2 ]^2, {s, 0, 1}]
Integrate[ Cos[ 2 Pi s ], {s, 0, 1}]
Integrate[ Cos[ 2 Pi s ]^2, {s, 0, 1}]

TrigReduce[ 2 Sin[a/2]^2]// TraditionalForm