# Calculate area under a curve

How do I analytically calculate using integration the area under the following curve?

$$x^2+ xy + y^2= 1$$

Its some ellipse and I see it might help that it's symmetric in exchange of x and y, so maybe I need to calculate just one half and because of this symmetry, just multiply by 2.

Thanks!

-
For what it's worth, you don't need to use integration. Can you see how to compute the lengths of its semimajor and semiminor axes? –  Qiaochu Yuan Jun 17 '11 at 20:11
To give the appropriate answer, it would help to know what tools you are familiar with. Calculus in one variable? In more than one variable? Some linear algebra? –  André Nicolas Jun 17 '11 at 21:17

There are several options. You could simply note that for an ellipse defined by

$$ax^2 + bxy + cy^2 = 1$$

the area is

$$A = \frac{2\pi}{\sqrt{4ac - b^2}}$$

Alternatively you could complete the square in $y$, re-writing as

$$\tfrac{3}{4}x^2 + (y + \tfrac{1}{2}x)^2 = 1$$

and hence

$$y = -\tfrac{1}{2} x \pm \sqrt{1 - \tfrac{3}{4}x^2}$$

You can now integrate to find the area under the top half of the ellipse, and double that to find the area of the whole ellipse. The limits of integration are those which make the term under the square root equal to zero, ie $x=\pm 2/\sqrt{3}$:

$$A = 2\int_{-2/\sqrt{3}}^{2/\sqrt{3}} \left(\sqrt{1 - \tfrac{3}{4}x^2} -\tfrac{1}{2} x \right)\, dx$$

One part of the integral is easy, and the part involving the square root can be done with a trigonometric substitution.

-
Thanks! I needed to know how to find those limits of integration. –  NumberFour Jun 17 '11 at 8:33
And when we do the integration we get the right area. But there is a methodological difficulty. Look at $x$ not far from the upper limit. There the integrand is negative! –  André Nicolas Jun 17 '11 at 19:30
Yes, you are right. You can see that it works by looking at the plot. As for an explanation of why it works... –  Chris Taylor Jun 17 '11 at 20:07
Yes, the answer will be right. We could (ouch!) break up the curve into "safe" regions. And during the ensuing calculation, we may find that because of cancellations we need not have broken it up. But the sensible thing is to rotate. The rotation need not be done explicitly. We can use the "completed squares" to find the dimensions of the rotated ellipse, and hence its equation if we really wish to integrate. The problem really belongs to two-variable calculus, make the obvious change of variable, compute the Jacobian, almost instant. –  André Nicolas Jun 17 '11 at 20:49

Well you can do this: $$\Bigl(x+\frac{1}{2}y\Bigr)^{2} + \frac{3}{4}y^{2} = 1 \Longrightarrow \Bigl(x+\frac{1}{2}y\Bigr)^{2} = 1-\frac{3}{4}y^{2} \Longrightarrow x = \sqrt{1-\frac{3}{4}y^{2}}-\frac{1}{2}{y}$$ Then the area will be $$\int x \ dy = \int \biggl[\sqrt{1-\frac{3}{4}y^{2}}-\frac{1}{2}{y}\biggr] \ dy$$ which can be integrated by trigonometric substitutions.

-

I'm surprised no one's mentioned that you can rotate to get rid of the $xy$ term.

Let's try something. Let

\begin{align} u & = (x+y)/2, \\ v & = (x-y)/2. \end{align} So that \begin{align} x & = u+v, \\ y & = u-v. \end{align} Then $$x^2 + xy + y^2$$ becomes $$(u+v)^2 + (u+v)(u-v) + (u-v)^2,$$ and this simplifies to $$(u^2+2uv+v^2) + (u^2-v^2) + (u^2 - 2uv + v^2) = 3u^2 + v^2.$$ There's no $uv$ term. Now you have $3u^2 + v^2 = 1$. The interior of this ellipse in the $uv$ plane has area $\pi\sqrt{3}$. Now notice that the usual unit square in the $xy$ plane maps to a square half as big in the $uv$ plane, so the area of the interior of the ellipse in the $xy$ plane should be twice as much, i.e. $2\pi\sqrt{3}$.

The transformation from $(x,y)$ to $(u,v)$ consists of rotating and dilating.

But you said area under the curve, and I'm wondering if that's the right question; maybe you meant area inside the curve?

-
Perhaps you meant to divide by $\sqrt{3}$ instead of multiplying. –  Scott Carnahan Jun 20 '11 at 10:25

Here's a more general version of user11667's answer that yields the discriminant formula in Chris Taylor's answer. In particular, I'd like to explain how the fact that a coordinate transform as seen in user11667's answer exists can be used to get an area formula of the form $\frac{2\pi}{\sqrt{4ac-b^2}}$ (in this case, $\frac{2\pi}{\sqrt{3}}$ for the whole ellipse, and $\frac{\pi}{\sqrt{3}}$ for the part above the $x$-axis).

If you have an ellipse described by the equation $ax^2 + bxy + cy^2 = 1$, the Principal Axis Theorem asserts that you can always change coordinates to diagonalize the quadratic form $ax^2 + bxy + cy^2$. That is, there are always variables $u$ and $v$ that are linear combinations of $x$ and $y$ such that substitution yields the equation $u^2 + v^2 = 1$. The area of the ellipse is then given dividing $\pi$ by the determinant of the linear transformation, i.e., the extra factor you see when changing variables for double integrals.

The coordinate change is given by a change of bases to the principal axes of the quadratic form, and you can find a description of an explicit algorithm in the Wikipedia article linked in the previous paragraph. The upshot is roughly as follows: We define the matrix $A = \binom{\,a \quad b/2}{b/2 \quad c\,}$, so the form $ax^2 + bxy + cy^2$ can be written as the matrix product $(x \quad y) A \binom{x}{y}$. The Principal Axis Theorem asserts that we can find a matrix $P$ satisfying $P^T \binom{10}{01}P = A$. Therefore, we can make a coordinate change $\binom{u}{v} = P\binom{x}{y}$ to get the equality $$ax^2 + bxy + cy^2 = (x \quad y) A \binom{x}{y} = (u \quad v)\binom{10}{01} \binom{u}{v} = u^2 + v^2.$$

The area enclosed by the ellipse is then $\frac{1}{\det(P)}$ times the area enclosed by a unit circle, that is, $\frac{\pi}{\det(P)}$.

In the case of the problem at hand, the symmetry between $x$ and $y$ implies the principal axes are on the lines $y = \pm x$, so you don't even need to execute the full algorithm to find user11667's variable change. Furthermore, you don't even need to compute the explicit coordinate change to find the area, because $\det(A) = \det(P^T)\det(P) = \det(P)^2$. That is, we need only divide by the square root of $\det A = ac-\frac{b^2}{4}$. The area of the ellipse is then $\frac{pi}{\sqrt{ac-b^2/4}} = \frac{2\pi}{\sqrt{4ac-b^2}}$.

This method works in higher dimensions: if you have an $n$-dimensional ellipsoid centered at the origin, defined by $q(\vec{x}) = 1$ for $q$ a (positive definite) quadratic form in $n$ variables, you can convert that form into a symmetric matrix $A$. The volume enclosed by the ellipsoid is then given by dividing the volume of the unit $n$-ball by $\sqrt{\det(A)}$. (If you want to know a formula for the volume of the unit $n$-ball I have a short derivation on MathOverflow.)

-