Q:

Evaluate $\int_c\tan ydx+x\sec ^2ydy$ where $C$ is any path from $(1,0)$ to $(2,\frac{\pi }{4})$

I got an answer of $\frac{4}{3}$, but the textbook answer says $2$. How would one solve it, and what did I do wrong? 
Let $\vec r=(1+t^2)\hat i+\arctan(t)\hat j$ where $0≤t≤1$
$dx=2tdt, dy=\frac{1}{1+t^2}dt, \sec^2y=1-\tan^2y$
$\int_c\tan ydx+x\sec ^2ydy=\int_0^1\tan(\arctan(t))\cdot 2tdt+(1+t^2)(1-\tan ^2(\arctan(t))\cdot \frac{1}{1+t^2}dt$
$=\int_0^1(2t^2+(1-t^2))dt$
$=\int_0^1(t^2+1)dt=\frac{4}{3}$
(Stewart Multivariable Calculus 4e, 13.3, Q19)

A:

You have a small sign/formula mistake:

$\sec^2y=1\color{red}{-}\tan^2y$

This should be: $\sec^2y = 1\color{blue}{+}\tan^2y$; so:

$\int_0^1(2t^2+(1\color{red}{-}t^2)) \,\mbox{d}t$

becomes:
$$\int_0^12t^2+\left(1\color{blue}{+}t^2\right)\,\mbox{d}t = 2$$

Alternatively, notice that:
$$\mbox{d}\left(x\tan y \right) = x\,\mbox{d}\tan y + \tan y \,\mbox{d} x = x\sec^2y\,\mbox{d}y + \tan y \,\mbox{d} x $$
so:
$$\int_C x\sec^2y\,\mbox{d}y + \tan y \,\mbox{d} x = \int_C \mbox{d}\left(x\tan y \right) = \left[ x\tan y \right]_{\left( 1,0 \right)}^{( 2,\pi/4)} = \ldots$$

