# Maximize the integral of a function over another variable

I have a simple question. This might be a theorem somewhere, but I do not know the appropriate keywords to find it. Please help.

Say there is a function $G(k,x) = \int_a^x f(k, t) dt$, and I wish to maximize $G(k,x)$ w.r.t. $k$. Under what conditions is this maximization problem equivalent to maximizing $f(k,t)$ w.r.t. $k$?

In short, when is the following true:

$\max_{k} \left\{\int_a^x f(k,t)\right\} dt \Leftrightarrow \max_{k} \{f(k,t)\}$

• When the lower limit and upper limit of the integral do not depend on k. – m0_as Jan 18 '17 at 22:39

## 1 Answer

Do you mean to find the argmax of $k$? Assuming nice differentiability and solution is interior, the solution is given by $\frac{\mathrm d}{\mathrm d k }G(k,x)=\int_a^x \frac{\mathrm d}{\mathrm d k }f(k,t) \mathrm d t =0$. You see immediately that if $k$ is the $\arg\max f(k,t)$ for all $t\in (a,x)$ then your claim is true.

• Thanks for the answer! Can you help me understand what is wrong with the following argument then? $$f(k,t) = cos(k+t) - k$$ $$G(k,x) = \int_0^x f(k,t) dt = sin(k+x) - sin(k) - kx$$ Maximizing $G(k,x)$ w.r.t. $k$ solves to $cos(k+x) - cos(k) - x = 0$ Maximizing $f(k,t)$ w.r.t. $k$ solves to $sin(k+t) - 1 = 0$. In short, there seems to be some dependence between $k$ and $t$ in $f$ which stops the result from holding. Or am I doing something wrong here? – Arpit Goel Jan 18 '17 at 22:57
• Yes, looking at the $f$, the argmax is different for different $t$. So there are dependence between $\arg \max_k f$ and $t$. – jim h Jan 18 '17 at 23:00
• Yes, so the answer does not hold always. Under what conditions on $f$, $G$ the following holds: $$\frac{d}{d k} G(k,x) = \int_{a}^{x} \frac{d}{dk} f(k,t) dt$$ – Arpit Goel Jan 18 '17 at 23:03
• very generally true. It is called the Leibniz rule (en.wikipedia.org/wiki/Leibniz_integral_rule) – jim h Jan 18 '17 at 23:36