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)
You have a small sign/formula mistake:
This should be: $\sec^2y = 1\color{blue}{+}\tan^2y$; so:
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$$