# Math Help - Line Integrals

1. ## Line Integrals

Evaluate the line integral $\int_C sin \ x \ dx + cos \ y \ dy$ where C consists of the top half of the circle $x^2+y^2=1$ from (1,0) to (-1,0) and the line segment from (-1,0) to (-2,3)

I got 0 for the line integral over the circle, and $Cos \ 1- Cos \ 2 +Sin \ 3$ over the line segment. However, the answer provided is $Cos \ 1- Cos \ 2 +Cos \ 3$. Can someone check?

Also, anyone know a way to evaluate line integrals on Mathematica?

2. Your line integral is right, I just checked. Maybe the arc needs to be expressed solely in terms of x or y, rather than $x^2 + y^2 = 1$? For example replace y with $sqrt(1 - x^2)$. However the integral becomes very complicated after that..

3. Thanks, I'll ask my TA if she possibly made a mistake.

4. Originally Posted by Andrew007
Your line integral is right, I just checked. Maybe the arc needs to be expressed solely in terms of x or y, rather than $x^2 + y^2 = 1$? For example replace y with $sqrt(1 - x^2)$. However the integral becomes very complicated after that..
Quick question though: would such a substitution change anything? It's still the same expression.

5. Originally Posted by MathTooHard

Also, anyone know a way to evaluate line integrals on Mathematica?
Mathematica can do line integrals if you supply the parameterization:

Here's yours:

Code:
In[24]:=
x[t_] := Cos[t];
y[t_] := Sin[t];
Integrate[Sin[x[t]]*Derivative[1][x][t],
{t, 0, Pi}] + Integrate[
Cos[y[t]]*Derivative[1][y][t],
{t, 0, Pi}]
x[t_] := t;
y[t_] := -3*t - 3;
Integrate[Sin[x[t]]*Derivative[1][x][t],
{t, -1, -2}] + Integrate[
Cos[y[t]]*Derivative[1][y][t],
{t, -1, -2}]

Out[26]=
0

Out[29]=
Cos[1] - Cos[2] + Sin[3]