Consider a point (x,y) and a thin cylindrical shell of thickness dx which has the y-axis as its axis of rotation. The volume of the shell is the surface area times the thickness: 2(pi)xydx, where x is the radius of the cylinder, y its height, and dx the thickness of the shell. In this context, y=cos(x)-sin(x) and, if we change the limits to 0<x<(pi)/4 we get half the volume we need (because of two symmetrical halves), so, using S to denote integral and [low,high] to denote integration limits, the complete volume of rotation=4(pi)S[0,(pi)/4](x(cos(x)-sin(x))dx)=4(pi)S[0,(pi)/4]((xcos(x)-xsin(x))dx)=4(pi)S[0,(pi)/4](xcos(x)dx)-4(pi)S[0,(pi)/4](xsin(x)dx). The solid is symmetrical about the line x=(pi)/4 where the curves intersect one another where sin(x)=cos(x) (i.e., tan(x)=1).
Let u=x, dv=cos(x)dx, then du=dx and v=sin(x). d(uv)/dx=udv/dx+vdu/dx=xcos(x)+sin(x), and, integrating wrt x:
xsin(x)=S(xcos(x)dx)+S(sin(x)dx).
Thus, S(xcos(x)dx)=xsin(x)-S(sin(x)dx)=xsin(x)+cos(x).
Now, let dv=-sin(x)dx, then v=cos(x). So, uv=xcos(x)=S(-xsin(x)dx)+S(cos(x)dx).
Thus, S(-xsin(x)dx)=xcos(x)-sin(x).
We now have all we need to carry out the original definite integration:
Volume of rotation=4(pi)(xsin(x)+cos(x)+xcos(x)-sin(x))[0,(pi)/4]=
4(pi)((pi)/4sqrt(2)+(pi)/4sqrt(2)-1)=4(pi)((pi)/2sqrt(2)-1)=(pi)^2sqrt(2)-4(pi)=1.3914 cu units.
The volume of rotation about the x axis is found by considering thin discs of radius y, thickness dx, where y=cos(x)-sin(x). The volume of each thin disc is (pi)y^2dx. The solid is symmetrical about the line x=(pi)/4 as before. This time the integral is 2(pi)S[0,(pi)/4]((cos(x)-sin(x))^2)dx)=2(pi)S[0,(pi)/4]((1-2sin(x)cos(x))dx)=2(pi)S[0,(pi)/4]((1-sin(2x))dx)=2(pi)(x+cos(2x)/2)[0,(pi)/4]=2(pi)((pi)/4-1/2)=(pi)^2/2-1=3.9348 cu units.