Hi! this is my first post on mathstackexchange, so I hope I can navigate successfully, including entering the LaTeX.
And, this will be embarrassing. But never mind, I really want to know what I'm doing wrong mathematically, and I'm hoping someone can point out my error.
Trying to evaluate the area inside an epicycloid: small circle rolling around the outside of a fixed bigger circle, a point $P$ on the circumference of the smaller circle traces this curve.
Somewhat general case: fixed circle radius $R$ centered on the origin $(0,0)$, small rolling circle radius $r$ centered initially at $(R+r,0)$, with $P$ at initial position $(R,0)$. Assume ratio $k=R/r$ is a positive integer. To keep the details to a minimum, consider a particular example. $R=3,\;r=1,\;$ so $k=3$, $P$ starts at $(3,0)$, this epicycloid has three lobes and it is given by $$x(\theta)=4\cos\theta-\cos(4\theta),\quad y(\theta)=4\sin\theta-\sin(4\theta).$$
The area inside this example can be calculated (as it can for the area of any such simple curve enclosing the origin) as $$A=\dfrac{1}{2}\int_0^{2\pi}(x^2+y^2)\,d\theta.$$ And in this particular case, I am confident that the area should work out to $20\pi$. Everyone says so, - even including my own accurate drawing of this rather nice trefoil (counting the little squares on a large sheet of graph paper). But when I do the calculation, below, I get that the area is $17\pi$? Where is my mistake, where am I missing something?
In this example, substituting for $x$ and $y$ : $$A=\dfrac{1}{2}\int_0^{2\pi}\left((4\cos\theta - \cos 4\theta)^2 + \left(4\sin\theta - \sin 4\theta\right)^2\right) \,d\theta$$
Expanding and rearranging, $$A=\dfrac{1}{2}\int_0^{2\pi}\bigl(\;16\cos^2\theta+16\sin^2\theta\;\;+\;\cos^2 4\theta+\sin^2 4\theta\;\; -\; 8(\cos 4\theta\cos\theta + \sin 4\theta\sin\theta )\;\bigr)\,d\theta$$
Simplifying, $$A=\dfrac{1}{2}\int_0^{2\pi}\bigl(\;16\;\;+\;1\;\; -\; 8\cos( 4\theta -\theta) \;\bigr)\,d\theta=\dfrac{1}{2}\int_0^{2\pi}(17-8\cos 3\theta)\,d\theta$$
This integrates to $$A=\dfrac{1}{2}\;\left|\;17\theta-\dfrac{8}{3}\sin 3\theta\;\right|_0^{2\pi}\;= 17\pi.$$
Presumably the mistake is that the "(+1)" in the integrand should somehow be, "(+4)"? But that does not look right.
Please, what is wrong with the above? I suppose the mistake is probably glaringly obvious, but I just can't see it. Grateful in advance for any assistance. Abashedly stumped, Terry