Green's Theorem on Line Integral I am asked to find the line integral for the following field:
$$F = (e^{y^2}-2y)i + (2xye^{y^2}+\sin(y^2))j$$
On the line segment with points $(0,0),(1,2)$ and $(3,0)$. I have to do it with Greens theorem. This is the setup I have so far.

$$\int_C F \cdot dr = \iint_D \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}\, dA$$
$$\frac{\partial Q}{\partial x} = ye^{y^2} \qquad \frac{\partial P}{\partial y}=2ye^{y^2}-2$$
Line from $(0,0)$ to $(1,2)$ is $y = 2x$. Line from $(1,2)$ to $(3,0)$ is $y = -x + 3$
$$\int_0^1\int_0^{2x}ye^{y^2}-2ye^{y^2}-2 + \int_1^3\int_0^{-x+3}ye^{y^2}-2ye^{y^2}-2 $$
$$\int_0^1\int_0^{2x}-ye^{y^2}-2 \, dy\,dx+ \int_1^3\int_0^{-x+3}-ye^{y^2}-2 \,dy\,dx$$
$$\int_0^1\left[\frac{e^{y^2}}{2} - 2y\right]_0^{2x} + \int_1^3\left[-\frac{e^{y^2}}{2} - 2y\right]_0^{-x+3}$$
$$\int_0^1\frac{e^{4x^2}}{2}-\frac{1}{2}-4x \,dx+ \int_1^3-\frac{e^{(-x+3)^2}}{2}-2(-x+3)+\frac{1}{2}\,dx$$
Let $u = -x + 3$ and $du = -1$.
$$\int_0^1\frac{e^{4x^2}}{2}-\frac{1}{2}-4x \,dx+ \int_1^3\frac{e^{(u)^2}}{2}+2(u)-\frac{1}{2}\,du$$

$$\left[\frac{e^{4x^2}}{8x}-\frac{x}{2}-2x^2 \right]_0^1+ \left[\frac{e^{(u)^2}}{4u}+u^2+\frac{u}{2}\right]_1^3$$
$$\left[\frac{e^{4x^2}}{8x}-\frac{x}{2}-2x^2 \right]_0^1+ \left[\frac{e^{(-x+3)^2}}{4(-x+3)}+(-x+3)^2+\frac{-x+3}{2}\right]_1^3$$
$$\frac{e^{4}}{8}-\frac{1}{2}-2 \,-\frac{e^{4}}{8}-4-1$$
$$\frac{1}{2}-2 \,-5$$

But the answer key says the answer is $-3$. Where have I gone wrong?
The problem lies in two places: the first one in $$\frac{\partial Q}{\partial x} = 2ye^{y^2},$$ but this is only algebraic, even though it made your life much harder.

The second one is much more sensible. Look at Green's Theorem
$$\oint_C (P dx + Q dy) = \iint_D \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}\,dA,$$ where D is CLOSED domain and $C = \partial D$.
Therefore, the integral you are suppose to have is

$$\int_C F \cdot dr = -\left[\iint_{\triangle} \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y}\, dA + \int_3^0 F(t,0) \cdot (1,0) \, dt\right],$$
where, $\triangle$ is the triangular domain of the question, $((0,0),(1,2),(3,0))$, and the the last term is the integral to bound you domain. Note that we integrate from $3 \to 0$ in order to close the domain, and we need the negative of RHS, because the chosen parametrization, that needs to respect the right-hand rule.

So, let
$$G(x,y) = \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y} = 2$$

We have
\begin{align}
\int_C F \cdot dr &amp;= -\left[ \int_0^1\int_0^{2x} G(x,y) \, dy\,dx + \int_1^3\int_0^{-x+3}G(x,y) \,dy\,dx + \int_3^0 F(t,0) \cdot (1,0) \, dt,\right]\\
&amp;= -\left[ \int_0^1\int_0^{2x} 2 \, dA + \int_1^3\int_0^{-x+3} 2 \,dA + \int_3^0 1 \, dt,\right]\\
&amp;= -\left[ 2\int_0^1\int_0^{2x}  \, dA + 2\int_1^3\int_0^{-x+3}  \,dA - \int_0^3  \, dt,\right]\\
&amp;=-\left[2\dfrac{1\times2}{2} + 2\dfrac{2 \times 2}{2} - 3 \right]\\
&amp;=-3
\end{align}
The partial derivative of $Q$ regarding $x$ lacks a factor $2$.