Is there a way to simplify an integral such as: $\lgroup{\int^T_0 r(t)u(t)dt}\rgroup ^2$ The expression appears in an optimal control problem where we seek to minimize the following cost function: $\lgroup{\int^T_0 r(t)u(t)dt}\rgroup ^2 + \lgroup{\int^T_0 s(t)u(t)dt}\rgroup $ The issue is that I have to express this function as in the form: $h(x(T)) + \int^T_0 g(x(t),u(t))\space dt$