# Maximizing electrostatic potential (Calculus 3 Optimization Problem)

• s3a
In summary: a) three values of t giving extrema for f(x(t),y(t)) = f(t), two at the top, one at the bottom.b) one value of t giving the intersection of the ellipse and the line y=x (the other intersection is the origin, f(0,0)=5)c) the curve is a closed curve, so the parametrisation repeats itself; hence the need to only consider t on the interval [0,2\pi )
s3a

## Homework Statement

The electrostatic potential at each point in the region 4x^2 + 9y^2 <= 36 is given by f(x,y) = 3x^2 + 2xy - y^2 + 5. Find the maximum potentials in the region.

(Without using Lagrange Multipliers).

The solution also said how to do it with Lagrange Multipliers but I think I understand that but I want to understand how to do it using this method. Also, if someone could tell me what this method is called it would be appreciated.

## Homework Equations

Partial derivatives and parametrization.

## The Attempt at a Solution

I looked through the full solution and I can see how to do it algebraically but I have some questions/confusions I need to settle.:

1) Why is f(0,0) = 5 not a valid final answer?
2) Why does parameterizing things to use a single variable t help?
3) What's the reasoning behind the 0 <= t < 2π constraint on t?

Any input would be GREATLY appreciated!

#### Attachments

• Solution.jpg
61.8 KB · Views: 505
s3a said:
1) Why is f(0,0) = 5 not a valid final answer?
2) Why does parameterizing things to use a single variable t help?
3) What's the reasoning behind the 0 <= t < 2π constraint on t?

Any input would be GREATLY appreciated!

Just like a single variable question, you must check the "interior" extremum and the points on the boundary.

With this mind, and without checking the working:
1) as there is a larger value (fmax) obtained on the boundary
2) the curve parameterised by t represents the boundary of the region of interest
3) the boundary is a circle so (0,2pi) is a natural choice, though you could choice any interval to parametrise over

lanedance said:
Just like a single variable question, you must check the "interior" extremum and the points on the boundary.

With this mind, and without checking the working:
1) as there is a larger value (fmax) obtained on the boundary
2) the curve parameterised by t represents the boundary of the region of interest
3) the boundary is a circle so (0,2pi) is a natural choice, though you could choice any interval to parametrise over

Actually, the boundary is an ellipse, but you can re-scale x and y to turn it into a circle; just choose X = 2x and Y = 3y. The boundary becomes X^2 + Y^2 = 36, and f(x,y) becomes F(X,Y).

RGV

Last edited:
good point

Thanks for the answers but I have more questions.

1) I can see why the interval would be [0,2π] since it's a circle. Just to be clear, it can be any interval as long as it's an interval covering a full period, right?

2) Why do the solutions say [0,2π) instead of [0,2π]?

3) Why do ∂f/∂x and ∂f/∂y only yield x = 0? Is it because, linearly, a circle only has rate of change 0 at the top and bottom (thinking of a 2D unit circle here for simplicity) which has a "shadow" down to x = 0?

4) What is the boundary in this problem algebraically (geometrically it is a sphere/circle as you guys stated)?

5) What is the "interior" in this problem algebraically?

Sorry for the stupid questions but please answer them as it will improve my grasp of the concepts.

1) yes as long as the parametrisation cpovers the whole boundary, you could use [0,1) if you wanted, you would just need to re-think the parameterisation

2) [0,2pi] would repeat one point on the boundary twice (x(0),y(0)) = (x(2pi),y(2pi))

3) don't understand the question

4) its given as $\frac{x^2}{4} + \frac{y^2}{9}=1$ which is an ellipse

5) the interior is all points in R^2 within the ellipse $\frac{x^2}{4} + \frac{y^2}{9}=1$

For the third point, I think I mixed in some nonsense with my question so I will rephrase it.

Basically, I was trying to ask why doing it the way with the partial derivatives involving x and y variables yields only x = y = 0 such that f(0,0) = 5 which is a minimum and doesn't yield a maximum whereas parameterizing it to a variable t successfully yields the maximum (as well as other extrema).

s3a said:
For the third point, I think I mixed in some nonsense with my question so I will rephrase it.

Basically, I was trying to ask why doing it the way with the partial derivatives involving x and y variables yields only x = y = 0 such that f(0,0) = 5 which is a minimum and doesn't yield a maximum whereas parameterizing it to a variable t successfully yields the maximum (as well as other extrema).

Because if the extremum occurs on the boundary the partial derivatives don't have be zero there.

1) Why and how does the equation with the t variables take into consideration the boundaries?

2) Why are there four values for t and not three? I ask this because 2π radians covers the entire circle so why is there an answer with +3π (the t_4 part)?

s3a said:
1) Why and how does the equation with the t variables take into consideration the boundaries?

2) Why are there four values for t and not three? I ask this because 2π radians covers the entire circle so why is there an answer with +3π (the t_4 part)?

On the boundary there are two local maxima and two local minima, for a total of 4 extrema.

RGV

That only answers the most recent #2 and how am I supposed to know that there are four extrema?

s3a said:
That only answers the most recent #2 and how am I supposed to know that there are four extrema?

What is preventing you from drawing a graph of the function f(t) for 0<= t <= 2Pi?

RGV

s3a said:
1) Why and how does the equation with the t variables take into consideration the boundaries?
The boundary is given by the constraint $4x^2 + 9y^2 \eq 36$

the following paramsterisation represents the curve (an ellipse) defined by the constraint $4x^2 + 9y^2 = 36$
$$\begin{pmatrix} x(t) \\ y(t) \end{pmatrix} = \begin{pmatrix} 3cos(t) \\ 2sin(t) \end{pmatrix}$$

to see this, substitute in as follows
$$4x(t)^2 + 9y(t)^2 = 36$$
$$4(3cos(t))^2 + 9(2sin(t))^2 = 36$$
$$4.9cos^2(t)) + 9.4sin^2(t) = 36$$
$$36(cos^2(t)) + sin^2(t)) = 36$$

s3a said:
2) Why are there four values for t and not three? I ask this because 2π radians covers the entire circle so why is there an answer with +3π (the t_4 part)?

$$2t_4 \approx 0.369+3 \pi$$

which gives
$$t_4 \approx 4.897 \leq 2 \pi$$

Earlier you/Dick said, that "if the extremum occurs on the boundary the partial derivatives [of the function f(x,y)] don't have be zero there." but let's consider the equation of the boundary with x and y variables. Why is it still giving me x = y = 0 instead of a maximum like the version with t variables does?

C(x,y) = x^2 /9 + y^2 /4 - 1
∂C/∂x = 2/9 * x = 0, ∂C/∂y = 2/4 * y = 1/2 * y = 0

x = y = 0

s3a said:
Earlier you/Dick said, that "if the extremum occurs on the boundary the partial derivatives [of the function f(x,y)] don't have be zero there." but let's consider the equation of the boundary with x and y variables. Why is it still giving me x = y = 0 instead of a maximum like the version with t variables does?

C(x,y) = x^2 /9 + y^2 /4 - 1
∂C/∂x = 2/9 * x = 0, ∂C/∂y = 2/4 * y = 1/2 * y = 0

x = y = 0

The function f(x,y) = 3x^2 + 2xy - y^2 + 5 has no max or min inside the region; the point (0,0) is NOT a max and NOT a min; it is a saddle point! You don't believe it? Look at f(t,0) for small t ≠ 0. You have f(t,0) = 2t^2 + 5 > f(0,0), so t = 0 is a min. That is, (0,0) is a min along the x-axis. Now look at f(0,t) = 5 - t^2. We have f(t,0) < f(0,0), so (0,0) is a max; that is, (0,0) is a max along the y-axis. So, within any neighbourhood of (0,0) there are points (x,y) giving f(x,y) > f(0,0) and other points (x,y) giving f(x,y) < f(0,0).

You should have tested this yourself; an application of the second order tests would have shown it right away.

RGV

Ray, your point was valuable to me and it made me have some other kind of epiphany but didn't quite address my confusion. The solution I attached in the initial post says "Then f[x(t), y(t)] = 27cos^2 (t) + 12cos(t) sin(t) - 4sin^2 (t) + 5 = F(t) on the boundary" but isn't f(x,y) the function describing the curve that's within (but not on) the boundary? That was my logic when taking partials ∂C/∂x = 2/9 * x = 0, and ∂C/∂y = 2/4 * y = 1/2 * y = 0 since C(x,y) is the function for the boundary - I called it C for constraint.

Sorry for asking too many questions. :(

s3a said:
Ray, your point was valuable to me and it made me have some other kind of epiphany but didn't quite address my confusion. The solution I attached in the initial post says "Then f[x(t), y(t)] = 27cos^2 (t) + 12cos(t) sin(t) - 4sin^2 (t) + 5 = F(t) on the boundary" but isn't f(x,y) the function describing the curve that's within (but not on) the boundary? That was my logic when taking partials ∂C/∂x = 2/9 * x = 0, and ∂C/∂y = 2/4 * y = 1/2 * y = 0 since C(x,y) is the function for the boundary - I called it C for constraint.

Sorry for asking too many questions. :(

I don't understand your confusion. The function f(x,y) does not have a max or a min inside the region, so we need to look on the boundary; that is, we must deal with the problem max/min f(x,y), subject to g(x,y) = 0. The derivatives of f need not (and usually will not) be zero at the optimal solution. That is why we use Lagrangians instead.

It so happens that in this particular problem we can parametrize the constraint curve in terms of an angle t in [0, 2*pi) and can therefore express the CONSTRAINED value of f as a function of t. That reduces the problem to a unidimensional optimization problem. That means that in this problem we can forget about using a Lagrangian and instead, use f itself---but f on the boundary, not anywhere else. You could arrive at exactly the same solutions by using the Lagrange multiplier method, but it takes more work.

Please tell me clearly: what part of the previous explanation do you not understand? I really cannot see what your problem is.

RGV

Ray Vickson, I really liked that last post you made! I just need to ask the a similar thing that I asked earlier though (but in a better expressed form): would the multi-dimensional alternative of getting f on the boundary be to solve for x and y at the intersection of f(x,y) = 0 = 3x^2 + 2xy – y^2 + 5 and 4x^2 + 9y^2 – 36 = 0? I ask because it seems that the exact same thing was done in the solution except that 4x^2 + 9y^2 – 36 = 0 was re-parametrized to a unidimensional problem (like you said) using the variable t.

The values of x and y seem to give f(x,y) = 0 (so I must be doing something wrong but I feel I'm actually getting closer):
http://www.wolframalpha.com/input/?i=0+%3D+3x^2+%2B+2xy+-+y^2+%2B+5,+4x^2+%2B+9y^2+-+36+%3D+0

I insist on this because I feel that understanding the alternative (multi-dimensional) setup would help the concept sink in my head.

(Hopefully, I did not say anything stupid this time.)

s3a said:
Ray Vickson, I really liked that last post you made! I just need to ask the a similar thing that I asked earlier though (but in a better expressed form): would the multi-dimensional alternative of getting f on the boundary be to solve for x and y at the intersection of f(x,y) = 0 = 3x^2 + 2xy – y^2 + 5 and 4x^2 + 9y^2 – 36 = 0? I ask because it seems that the exact same thing was done in the solution except that 4x^2 + 9y^2 – 36 = 0 was re-parametrized to a unidimensional problem (like you said) using the variable t.

The values of x and y seem to give f(x,y) = 0 (so I must be doing something wrong but I feel I'm actually getting closer):
http://www.wolframalpha.com/input/?i=0+%3D+3x^2+%2B+2xy+-+y^2+%2B+5,+4x^2+%2B+9y^2+-+36+%3D+0

I insist on this because I feel that understanding the alternative (multi-dimensional) setup would help the concept sink in my head.

(Hopefully, I did not say anything stupid this time.)

If you want to maximize f(x,y) [or minimize it] you do _not_ want to set f(x,y) = 0; that might not even be possible, as the example f(x,y) = (x + 2y - 3)^2 + (4x - y)^2 shows (this f is > 0 for all real numbers x and y).

The problem you started with is max/min f(x,y) = 3x^2 + 2xy - y^2 + 5, subject to 4x^2 + 9y^2 <= 36. This has a max at (x,y) = +-(A1/C1,B1/C1), where A1 = 18*sqrt(2), B1 = sqrt(2)*[sqrt(1105) - 31] and C1 = sqrt[1105 - 31*sqrt(1105)] (so (x,y) = +-(2.94899,0.36724) and f = 33.1208). It has a min at (x,y) = +-(A2/C2,B2/C2), where A2 = -18*sqrt(2), B2 = sqrt(2)*[31 + sqrt(1105)] and C2 = sqrt[1105 + 31*sqrt(1105)] (so (x,y) = +-(-0.55086,1.96599) and f = -0.12077).

You seem to be confused about the nature of the point (0,0), where the derivatives of f vanish. As I already said _several times_, the point (0,0) is NOT a max or a min; it is a saddle point. The max and min of f lie on the boundary of the constraint set, and the derivatives of f do not vanish there.

RGV

Can you elaborate on how you got A_1, B_1, C_1, A_2, B_2, and C_2 as well as how you get max (x,y) = +-(A_1/C_1,B_1/C_1) and min (x,y) = +-(A_2/C_2,B_2/C_2)? It seems to me that this is the two dimensional approach I was requesting but I just don't see how the very first step(s) required to get to what you got is/are. Like, I'm thinking it's the outcome of the intersection of f(x,y) = 3x^2 + 2xy – y^2 + 5 and g(x,y) = 4x^2 + 9y^2 – 36 and if so, I'm asking for the steps after this and before what you wrote or at least how to vaguely conduct the algebra myself without actually doing all the tedious stuff if it's tedious.

s3a said:
Can you elaborate on how you got A_1, B_1, C_1, A_2, B_2, and C_2 as well as how you get max (x,y) = +-(A_1/C_1,B_1/C_1) and min (x,y) = +-(A_2/C_2,B_2/C_2)? It seems to me that this is the two dimensional approach I was requesting but I just don't see how the very first step(s) required to get to what you got is/are. Like, I'm thinking it's the outcome of the intersection of f(x,y) = 3x^2 + 2xy – y^2 + 5 and g(x,y) = 4x^2 + 9y^2 – 36 and if so, I'm asking for the steps after this and before what you wrote or at least how to vaguely conduct the algebra myself without actually doing all the tedious stuff if it's tedious.

For the problem $\max/\min f(x,y) = 3x^2 + 2xy – y^2 + 5,$ subject to $g(x,y) = 4x^2 + 9y^2 – 36 \leq 0,$ the optimum occurs on the boundary g = 0. Letting the Lagrangian be $L = f - u g$ (where u is the Lagrange multiplier), the optimality conditions are
$$L_x \equiv \partial{L}/\partial{x} = (6-8u)x +2y = 0 \text{ and } L_y \equiv \partial{L}/\partial{y} = 2x -(2+18u)y = 0.$$ This system of equations is linear in x and y and homogeneous. In order to have a nonzero solution we need to have the determinant of the coefficient matrix = 0, that is, we need
$$\left| \begin{array}{cc} 6-8u & 2 \\ 2 & -2-18u \end{array}\right| = 0,$$
or $$144u^2 - 92u - 16 = 0 \longrightarrow u = u_1 = \frac{23}{72} + \frac{\sqrt{1105}}{72} \text{ or } u = u_2 = \frac{23}{72} -\frac{\sqrt{1105}}{72}.$$

Using $u = u_1 \text{ in } L_x = 0$ gives
$$\left(\frac{31}{9} - \frac{\sqrt{1105}}{9}\right) x + 2y = 0,$$ so we can get
$$x = \frac{18 y}{31 - \sqrt{1105}},$$ and substituting this into the equation g = 0 we get two roots for y, in the form $y = \pm \, y_1.$ Substituting these back into the formula for x gives two values of x. These two points are the constrained maxima.

Similarly, if we use $u = u_2$ and repeat the above steps we obtain two mirror-image points that are the minima.

RGV

Okay, so it is mandatory (out of the two options we're considering at least) to use the Lagrange Multiplier method to compute the multi-dimensional variant of this problem?

s3a said:
Okay, so it is mandatory (out of the two options we're considering at least) to use the Lagrange Multiplier method to compute the multi-dimensional variant of this problem?

No, there is no such a thing as "mandatory" in these cases. Sometimes one method works well, but sometimes another method works better---it depends on the problem---and (unfortunately) the only way to know what works is to try it out. Sometimes you spend a lot of time and effort trying to solve a problem using method A, only to learn that was a poor choice, so you go back and do it over again using method B. We have all faced that situation.

RGV

I meant for this particular problem and not generally speaking. Did you opt for the Lagrange Multiplier method because there wasn't any other good way to do this in two dimensions?

Would something along the lines of solving for x in the g(x,y) = 0 = 4x^2 + 9y^2 - 36 equation and then plugging that value of x into the f(x,y) = 3x^2 + 2xy - y^2 + 5 equation work?

s3a said:
I meant for this particular problem and not generally speaking. Did you opt for the Lagrange Multiplier method because there wasn't any other good way to do this in two dimensions?

Would something along the lines of solving for x in the g(x,y) = 0 = 4x^2 + 9y^2 - 36 equation and then plugging that value of x into the f(x,y) = 3x^2 + 2xy - y^2 + 5 equation work?

I generally start by trying the Lagrange multiplier method *if the constraints are nonlinear*. If the constraints are linear, one method is about as good as another; depending on exactly what is the problem, one method may definitely be better than another, but not by an overwhelming factor.

As to your question about solving/substituting: there is always the problem of solution choice: the equation g = 0 is quadratic in y, so has two roots:
$$y= y_1(x) \equiv \frac{2}{3}\sqrt{9-x^2}, \; y = y_2(x) \equiv - \frac{2}{3}\sqrt{9-x^2}.$$
Also, using the method can produce a very much more complicated problem, but in a lower number of variables. For example, using y = y_1(x) in f(x,y) gives
$$f_1(x) = f(x,y_1(x)) = 1+\frac{31}{9}x^2 + \frac{4}{3} x \sqrt{9 - x^2}.$$ If we want to find the stationary points we need to solve
$$f_1'(x) = \frac{2(54 - 12x^2 + 31x \sqrt{9-x^2})}{9\sqrt{9-x^2}} = 0,$$
or $54 - 12x^2 + 31 x \sqrt{9 - x^2} = 0.$ How do you like that last equation?

RGV

I don't know if you were trying to imply that that last equation is ugly/difficult but I find that it is quite do-able actually. Having said that, my troubles have been solved and my curiosity has been satisfied. :)

Thank you very much!

Actually, I spoke a bit too fast (however, this one is minor):

If I used x = 3sin(t) and y = 2cos(t) instead of x = 3cos(t) and y = 2sin(t), I get

tan(2t) = -12/31 instead of tan(2t) = 12/31.

I wrote some Java code that computes the correct answers (for the extrema on the boundary) with tan(2t) = 12/31 but when I change it to tan(2t) = -12/31, I get the wrong f(x,y)_max value (for example).

Just change the line double t1 = Math.atan(12.0/31.0)/2.0; to double t1 = Math.atan(-12.0/31.0)/2.0;. What's wrong with my thinking?

Here is the code:

import java.lang.Math;

public class CalculateThis
{
public static void main(String[] args)
{
new CalculateThis();
}

public CalculateThis()
{
// Extremums in t variables
System.out.println("Extremums in t variables");

double t1 = Math.atan(12.0/31.0)/2.0;
System.out.println(t1);
double t2 = t1 + Math.PI/2;
System.out.println(t2);
double t3 = t2 + Math.PI/2;
System.out.println(t3);
double t4 = t3 + Math.PI/2;
System.out.println(t4);

// Extremums in x,y variables
System.out.println("Extremums in x,y variables");

double extX1 = 3.0 * Math.cos(t1);
double extY1 = 2.0 * Math.sin(t1);

System.out.println(extX1);
System.out.println(extY1);

System.out.println("f(x,y) result:" + formulaResult(extX1, extY1));

double extX2 = 3.0 * Math.cos(t2);
double extY2 = 2.0 * Math.sin(t2);

System.out.println(extX2);
System.out.println(extY2);

System.out.println("f(x,y) result:" + formulaResult(extX2, extY2));

double extX3 = 3.0 * Math.cos(t3);
double extY3 = 2.0 * Math.sin(t3);

System.out.println(extX3);
System.out.println(extY3);

System.out.println("f(x,y) result:" + formulaResult(extX3, extY3));

double extX4 = 3.0 * Math.cos(t4);
double extY4 = 2.0 * Math.sin(t4);

System.out.println(extX4);
System.out.println(extY4);

System.out.println("f(x,y) result:" + formulaResult(extX4, extY4));
}

public double formulaResult(double x, double y)
{
double result = 3.0 * Math.pow(x, 2.0) + 2.0 * x * y - Math.pow(y, 2.0) + 5.0;
return result;
}
}

s3a said:
I don't know if you were trying to imply that that last equation is ugly/difficult but I find that it is quite do-able actually. Having said that, my troubles have been solved and my curiosity has been satisfied. :)

Thank you very much!

Of course it is do-able; I never claimed it wasn't. I just asked you how you like it; personally, I don't much like it myself, but if there was no other way to proceed, I would deal with the equation anyway.

But, the point I was making really rears its ugly head if you have, say 4 or 5 variables and two or three nonlinear constraints. Then the equations become truly unmanageable, except using numerical methods (which, BTW, is done all the time in applications, using sophisticated modern optimization packages that have been developed by teams of researchers over decades of trying).

RGV

Could you answer me for my tan(2t) = -12/31 problem? (I'm just repeating in case you didn't see it because of the timing of that post.)

I noticed that multiplying the angles in the sine functions all by -1 in the code yields the correct answer along with double t1 = Math.atan(-12.0/31.0)/2.0;.

So basically, taking the negative arctan and the negative sines yield the same extrema. Why exactly is this the case? I'd appreciate an explanation that can make it stick for me in a problem-independent way.

Edit: Is there a reason why it would be wrong to use x = 3sin(t) and y = 2cos(t) instead of x = 3cos(t) and y = 2sin(t)?

Last edited:

## What is electrostatic potential?

Electrostatic potential is the amount of energy required to bring a unit positive charge from infinity to a specific point in an electric field. It is a measure of the strength of the electric field at that point.

## Why is maximizing electrostatic potential important?

Maximizing electrostatic potential is important in various applications such as designing efficient electronic devices, optimizing energy storage systems, and understanding the behavior of charged particles in electric fields.

## What is the process for maximizing electrostatic potential?

The process for maximizing electrostatic potential involves using the principles of calculus, specifically optimization techniques, to find the maximum value of the electrostatic potential function. This involves finding the critical points and determining whether they are maximum points.

## What are the factors that affect electrostatic potential?

The factors that affect electrostatic potential include the magnitude and distribution of charges, the distance between charges, and the dielectric constant of the medium in which the charges are located.

## What are some real-life applications of maximizing electrostatic potential?

Some real-life applications of maximizing electrostatic potential include designing efficient capacitors and batteries, optimizing the performance of electronic devices, and understanding the behavior of charged particles in plasma physics and astrophysics.

• Calculus and Beyond Homework Help
Replies
11
Views
3K
• Calculus and Beyond Homework Help
Replies
4
Views
1K
• Calculus and Beyond Homework Help
Replies
8
Views
710
• Calculus and Beyond Homework Help
Replies
12
Views
2K
• Calculus and Beyond Homework Help
Replies
10
Views
2K
• Electromagnetism
Replies
2
Views
835
• Calculus and Beyond Homework Help
Replies
2
Views
600
• Calculus and Beyond Homework Help
Replies
3
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
1K
• Calculus and Beyond Homework Help
Replies
1
Views
588