To begin, let's first apply the sum rule to break intcosx-sec^2xdx∫cosx−sec2xdx into intcosxdx-intsec^2xdx∫cosxdx−∫sec2xdx. Now we can evaluate these integrals one by one:
intcosxdx=sinx+C->∫cosxdx=sinx+C→ (the derivative of sine is cosine, so the antiderivative of cosine is sine)
intsec^2xdx=tanx+C->∫sec2xdx=tanx+C→ (same logic)
The whole solution is: f(x)=sinx+C-tanx+Cf(x)=sinx+C−tanx+C. Because CC is just some constant, C+CC+C is just another constant, so we can write: f(x)=sinx-tanx+Cf(x)=sinx−tanx+C. To solve for CC, we use the given initial condition that f(pi/8)=-1f(π8)=−1:
-1=sin(pi/8)-tan(pi/8)+C−1=sin(π8)−tan(π8)+C
-1=(sqrt(2-sqrt(2)))/2-(sqrt(2)-1)+C−1=√2−√22−(√2−1)+C
0=(sqrt(2-sqrt(2)))/2-sqrt(2)+2+C0=√2−√22−√2+2+C
C=-(sqrt(2-sqrt(2))-2sqrt(2)+4)/2~~-0.968C=−√2−√2−2√2+42≈−0.968
Thus, f(x)=sinx-tanx-(sqrt(2-sqrt(2))-2sqrt(2)+4)/2f(x)=sinx−tanx−√2−√2−2√2+42, or, using an approximation, f(x)=sinx-tanx-0.968f(x)=sinx−tanx−0.968.