Finding a Line Integral Along a Piecewise-Smooth Curve

Find \(\int_{C}(xy\,dx+x^{2}\,dy)\) along the piecewise-smooth curve \(C\) illustrated in Figure 21.

Solution The values of the line integral along each of the smooth curves \(C_{1},\) \(C_{2},\) \(C_{3}\), and \(C_{4}\) are \[ \begin{eqnarray*} C_{1}{:}&& y =\dfrac{1}{3}x,\quad dy=\dfrac{1}{3}dx;\qquad 0\leq x\leq 3 \\ &&{\int_{C_{1}}(xy\,dx+x^{2}\,dy)=\int_{0}^{3}\left[ x\left( \dfrac{1}{3}x\right) dx+x^{2}\dfrac{1}{3}dx\right] =6} \\ C_{2}{:}&& x =3,\quad dx=0;\qquad 1\leq y\leq 2 \\ &&{\int_{C_{2}}(xy\,dx+x^{2}\,dy)=\int_{1}^{2}9\,dy=9} \\ C_{3}{:}&& y =2, \quad dy=0;\qquad \color{#0066A7}{\hbox{Watch the orientation here: \(x\) varies from 3 to 2.}} \\ &&{\int_{C_{3}}(xy\,dx+x^{2}\,dy)=\int_{3}^{2}2x\,dx=\left[x^{2}\right]^{2}_{3}=-5} \\ C_{4}{:}&& y =x, \quad dy=dx;\qquad \color{#0066A7}{\hbox{Watch the orientation here: \(x\) varies from 2 to 0.}} \\ &&{\int_{C_{4}}(xy\,dx+x^{2}\,dy)=\int_{2}^{0}(x^{2}\,dx+x^{2}\,dx)=2\int_{2}^{0}x^{2}dx=-\dfrac{16}{3}} \end{eqnarray*} \]

Then \[ \int_{C}(xy\,dx+x^{2}\,dy)=6+9-5-\dfrac{16}{3}=\dfrac{14}{3} \]