# derivative with respect to a function under integral

I want to take derivative with respect to $p(t)$, but I am not sure if I can just assume $p(t)$ is another variable since it depends on $t$.

$$\pi = \int_a^b p(t)\cdot \bigl(a-b\cdot p(t)\bigr)\cdot(u- v \cdot t)\, dt$$ Thanks

-
Then don't assume; just replace $p(t)$ with $p(t)+h \phi(t)$ where $\phi$ is a function and $h$ is a real number; evaluate the integral; differentiate the result with respect to $h$. You'll get the directional derivative in the direction $\phi$. – user31373 May 16 '12 at 21:16
I am sorry, I am not clear what to do. I don't know the function form of p(t). What I am trying to do is to take derivative with respect to p(t) and equate that with zero to find the optimal function form for p(t). Would this clarification make any change in your response? Thanks – Eln May 16 '12 at 21:24

## 1 Answer

Okay, I'll expand my answer. For any fixed functions $p$ and $\phi$ the expression $\int_a^b (p(t)+h\phi(t))(a−bp(t)-bh\phi(t))(u−vt)dt$ is a function of the real variable $h$. So we can take derivative with respect to $h$ and equate that to $0$. If you are unsure about legitimacy of taking $\frac{d}{dh}$ under the integral sign, just expand the product and move the powers of $h$ out of the integrals. Like this: $$\int_a^b p(t)(a−bp(t))(u−vt)dt + h\left(\int_a^b \phi(t)(a−bp(t))(u−vt)dt + \int_a^b p(t)(-b\phi(t))(u−vt)dt\right) + h^2 \int_a^b \phi(t)(-b\phi(t))(u−vt)dt$$ If $p$ is an extremal function for this functional, the derivative $\frac{d}{dh}$ will be zero when $h=0$. So, $$\int_a^b \phi(t)(a−bp(t))(u−vt)dt + \int_a^b p(t)(-b\phi(t))(u−vt)dt = 0$$ (You notice that the effort put into extracting $h^2$ was wasted.) Combine the integrals and factor out $\phi$: $$\int_a^b \phi(t)\left[(a−bp(t))(u−vt)-bp(t)(u-vt)\right]\,dt = 0$$ Since $\phi$ could be any integrable function, the expression in square brackets must be $0$ identically. This gives you an equation for $p$.

-
@Elnaz Yes, formal manipulations lead to the correct result, as they do so often in calculus. It's still worthwhile to read an introduction to the Calculus of Variations to learn what is really going on. – user31373 May 16 '12 at 22:39
Thank you so much. I figured how to type equation here! I was actually looking in Amazon for a book to read again. I would be grateful if you can suggest me a book. I am a phd student in business school. Our research is supposed to not include complicated math, which seems that I am lacking even the easy math. I truly appreciate your help. – Eln May 16 '12 at 22:44
The basic idea of variation (plug $p+h \phi$, and equate the derivative $\frac{d}{dh}$ to zero; then use the fact that $\phi$ was arbitrary) appears on the first pages of any book on the subject. I like "Calculus of Variations" by Gelfand and Fomin (published by Dover). – user31373 May 16 '12 at 23:12
Thanks. I just ordered the book. I figured out a mistake in what I was saying before. The expression in bracket simplifies to: $$(a-2bp(t))(u-vt)=0$$ $$p(t)=\frac{a}{2b}$$ which doesn’t look right, since not a function of t. Is that right? – Eln May 17 '12 at 0:01
@Elnaz It's still a function; a constant function. The answer is not surprising since you imposed no constraints on $p$. If the function $p$ is free to attain any values it pleases, it will simply maximize the product $p(t)(a-b p(t))$ for each $t$; the maximum is attained when $p(t)=a/(2b)$. So, you should consider whether there are any constraints on $p$. Also think about the sign of $u-vt$, and whether you want to maximize or minimize $\pi$. – user31373 May 17 '12 at 0:12