I am using the book, "Introduction to Electrodynamics, by Griffith" and it asks the following question.
Calculate the line integral of the function $\vec{f}(\vec{v}) = 2x^3\hat{x} - yx \hat{y} + x^2\hat{z}$ from the origin to the point $(1,1,1)$ by three different routes:
$$a.) \ (0,0,0)\to (1,0,0)\to (1,1,0)\to (1,1,1)$$ $$b.) \ (0,0,0)\to (0,0,1)\to (0,1,1)\to (1,1,1)$$ $$c.) \text{ The direct straight line}$$
For $a$ I got the following:
$$\text{From } (0,0,0)\to (1,0,0) : y=z=0 \therefore \int f\cdot dl = \int^1_0 2x^3dx = \frac{1}{2}$$ $$\text{From } (1,0,0)\to (1,1,0) : x=1, z=0, y: 0\to 1 \therefore \int f\cdot dl = \int^1_0 yxdy = \int^1_0 ydy =- \frac{1}{2}$$ $$\text{From } (1,1,0)\to (1,1,1) : x=y=1, z=0\to 1 \therefore \int f\cdot dl = \int^1_0 x^2dz = \int^1_0 dz =1$$
Thus $a = 1$.
For $b$ I got the following:
$$\text{From } (0,0,0)\to (0,0,1) : x=y=0, z: 0\to 1 \therefore \int f\cdot dl = \int^1_0 x^2dz = 0$$ $$\text{From } (0,0,1)\to (0,1,1) : x=0, z=1, y: 0\to 1 \therefore \int f\cdot dl = \int^1_0 yxdy = 0$$ $$\text{From } (0,1,1)\to (1,1,1) : z=y=1, x=0\to 1 \therefore \int f\cdot dl = \int^1_0 2x^3dx = \frac{1}{2}$$
Thus $b = 1/2$.
For $c$ not sure what they mean by direct straight line? Also, will like to know if I my calculations for $a$ and $b$ are correct?
$$y=x, z=x, dz=dx, dy=dx$$ $$x=y=z \implies :0\to 1$$ thus the limits is from $0$ to $1$ $$\therefore \int^1_0 2x^3dx - x^2dx+x^2dx = \int^1_0 2x^3dx = 1/2$$
For parts a and b, you need to add together the pieces of the trajectories
For part c, on the trajectory from $(0,0,0)$ to $(1,1,1)$ you have $x=y=z$ at any point, and $d\vec l$ pointing along $\hat x+\hat y+\hat z$: $$d\vec l=|dl|\frac {1}{\sqrt3}(\hat x+\hat y+\hat z)$$ The limits of integration are from $0$ to $\sqrt 3$.