I have reviewed questions on MMMA Stack Exchange and found no help. Here's my problem and my code, which only partially works. I can't figure out my mistake. Help?
Find the mass and COM of a wire in the shape of a helix, $x = t, y = cos t, z = sin t$ where t is between 0 and 2 $pi$ if the density at any point is equal to the square of the distance from the origin.
Here's my code. It accurately calculates mass, but it fails at any of the 3 points for COM. For ease, the y and z COM coordinates are 0 and 0, according to the answer key. I just can't figure out how to code to find them.
Here's my code:
Clear[A, x, y, R, F, G](*Along scalar fields*)
x[t_] := t (*Parametrize the curve*)
y[t_] := Cos[t]
z[t_] := Sin[t]
R[t_] := {x[t], y[t], z[t]}
F[t_] := x[t]^2 + y[t]^2 +
z[t]^2 (*this is the parametrized mass density function*)
\
Print["The mass is:"]
Integrate[
F[t]*Norm[R'[t]], {t, 0,
2 Pi}] (*Calculates mass and check region,t,here*)
A = %;
G[t] := F[t]*
x[t];(*multiplies by x for x coord*)
Print["The x coordinate of the \
center of mass is:"]
Integrate[G[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A
Print["The y coordinate of the center of mass is:"]
H[t] := F[t] * y[t]
Integrate[H[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A
Print["The z coordinate of the center of mass is:"]
J[t] := F[t] * z[t]
Integrate[J[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A