# Calculus of variations question

1. Sep 28, 2006

### spock0149

I need to find the maximum value of

$$A[y(x)]= \int_{0}^{1}y^2 dx$$

with boundary conditions y(0)=y(1)=0 and

$$\int_{0}^{1}(\frac{dy}{dx})^2=1$$

Do I have to use the Euler lagrange equations? I thought that found the minimum value??

Any hints on the steps to take would be appreciated.

Last edited: Sep 28, 2006
2. Sep 28, 2006

### HallsofIvy

Staff Emeritus
Euler Lagrange equations find 'extreme' values- either max or min- just like the derivative test in calclulus.

3. Sep 28, 2006

### spock0149

Hmmm. so how does this sound:

$$\frac{\partial f}{\partial y} - \frac{\partial}{\partial x}\frac{\partial f}{\partial y_x}=0$$

and we have

$$f=y^2$$

so then

$$2y-0 = 0$$

So y=0

I don't think this is correct. What is the approach please?

Last edited: Sep 28, 2006
4. Sep 28, 2006

### StatusX

y=0 certainly extremizes (in this case minimizes) the integral of y^2, so that looks right.

5. Sep 29, 2006

### spock0149

Hmmmm, I need to find the maximum value, is there one?

6. Sep 29, 2006

### arildno

You must use a Lagrange multiplier since you have a constraint problem!
We look at the problem:
$$\hat{A}=\int_{0}^{1}y^{2}dx-\lambda(\int_{0}^{1}(\frac{dy}{dx})^{2}dx-1)=\int_{0}^{1}(y^{2}+\lambda((\frac{dy}{dx})^{2}-1))dx,y(0)=y(1)=0, \int_{0}^{1}(\frac{dy}{dx})^{2}dx-1=0$$
where lambda is the Lagrange multiplier.
The associated Euler-Lagrange equation is therefore:
$$2y+2\lambda\frac{d^{2}y}{dx^{2}}=0\to{y}(x)=A\cos(\sqrt{\lambda}x)+B\sin(\sqrt{\lambda}x)$$
Using the boundary conditions yields $A=0, \lambda=\pi^{2}$
whereas a suitable B can be found by the constraint:
$$B^{2}\pi^{2}\int_{0}^{1}\cos^{2}({\pi}x)dx=1\to{B}=\pm\frac{\sqrt{2}}{\pi}$$

Last edited: Sep 29, 2006
7. Sep 29, 2006

### StatusX

I have a bad habit of not reading people's question fully before answering. Let me now officially make the resolution to kick this habit. Ok, I feel better now.

8. Oct 4, 2006

### spock0149

Awesome post Arildno.

This really have me somewhere to start and using this I could actually figure out what my math book was (not) explaining to me.

One thing, in your first line you subtract the term containing the lagrange multiplier, and then directly after that you add it.

Was this a mistake or is there something I'm just not getting.

Also, is the maximum value of the function just when Cos(x) goes to 1?

Thanks again.

9. Oct 5, 2006

### arildno

Just a typo on my part.
I don't get your second question.

10. Oct 5, 2006

### spock0149

Oh ok thanks.

Well, the question asked for the maximum value of the function A[y(x)] and so as we discovered the the function was:

$$\frac{\sqrt 2}{\pi}sin(\sqrt\lambda x)$$

so is the maximum value when the sin term goes to 1?

11. Oct 5, 2006

### arildno

No, first of all:
A(y(x)) is a SCALAR, not a function!

We have, for the extremum function satisfying the given constraint:
$$\hat{A}(y)=\frac{\sqrt{2}}{\pi}\int_{0}^{1}\sin^{2}(\pi{x})dx=\frac{1}{\sqrt{2}\pi}$$

Furthermore, it is provable that this represents a local MINIMUM, not a maximum.

12. Oct 5, 2006

### spock0149

Is that because the second derivative of y is positive?

Hold on, If y^2 is sin^2 then the second derivative will be negative won't it?

Thanks for your patience with me.

:)

13. Oct 5, 2006

### spock0149

Actually I want to verify a small sign mistake with you that alters the solution:

$$g=y^2+\lambda({\frac{\partial y}{\partial x}}^2-1)$$
and the euler lagrange equations are:
$$\frac{\partial g}{\partial y}-\frac{d}{dx}{\frac{\partial g}{dy'}}=0$$

Which gives us

$$y-\lambda y''=0$$

Which has exponential solutions:

$$Ae^{\sqrt{\lambda}x}+Be^{-\sqrt{\lambda}x}$$

Could you possibly verify this?

Thank-you

14. Oct 5, 2006

### arildno

Well, that's true enough if you use the plus sign, rather than the minus sign. In that case, the solution of the boundary value problem requires imaginary square root of lambda in order to provide a non-zero solution.
The complex exponential is, of course, directly related to the trig. functions.
Thereby, you get the solution I gave you using the minus sign.

Last edited: Oct 5, 2006
15. Oct 5, 2006

### spock0149

Hmmm...am I right in saying that its up to you which sign you give lambda?

I prefer your solution by the way! ;)

Oh, one last thing: You mentioned that:

$$\lambda=\pi^2$$

Should this be $$\lambda=n^2\pi^2$$

Or can we forget about the n?

Last edited: Oct 5, 2006
16. Oct 5, 2006

### arildno

No, it isn't. When applying the boundary conditions, the only viable exponential function is a complex choice (imaginary square root of lambda). Just try it!

I have to bit back what I said about the stationary function being a minimum, it is only a saddle point. Sorry about that; I got confused by my own sign mistake..

17. Oct 5, 2006

### spock0149

Ok:

$$y=Ae^{\sqrt{\lambda}x}+Be^{-\sqrt{\lambda}x}$$

Applying BC's

$$y(0)=0$$

So, A=0

And $$y(1)=0$$
So
$$0=Be^{-\sqrt \lambda}$$

Writing out as hyperbolic functions:

$$B(sinh(-\sqrt\lambda)+cosh(-\sqrt\lambda)=0$$

This gives us:

$$-tanh(\sqrt\lambda)=0$$

I'm getting lost now...

18. Oct 5, 2006

### arildno

You can perfectly well use the n as well, so you have multiple stationary points for this problem, one for each n.

19. Oct 5, 2006

### spock0149

I think we typed our questions at the same time!

20. Oct 6, 2006

Arildno?