### can sage be made to do this algebra?

Enneper's wire lies on an ellipsoid. I want to prove the curvature
vector of Enneper's wire always points inward (never tangent to
the ellipsoid). The plan is to show that the dot product of the
curvature vector with the inward normal to the
ellipse is strictly positive.

So I start like this:

R,t = var('R,t')
X = vector((R * cos(t) - (1/3)* R^3 * cos(3*t),
- R * sin(t) - (1/3) *R^3 * sin(3*t),
R^2 *cos(2*t)))
Xtheta = X.diff(t)
T = 1/(abs(Xtheta)) * Xtheta # unit tangent
kappavector = T.diff(t)
EllipsoidNormal = vector((-2*R*cos(t) + (2/3)*R^3*cos(3*t),
2*R*sin(t) + (2/3)*R^3 * sin(3*t),-(4/3)*R^2*cos(2*t)))
test = EllipsoidNormal.dot_product(-kappavector).trig_simplify()
print(test)

So far so good. (I guess you have to click edit to see the paste-able code.)
~~ But the ~~Ideally test > 0 would return true. Well then, we want to simplify test
further until it is clearly positive. The result sage finds for 'test'
admits further simplifications. I wanted to
post a picture of those simplifications (typeset in TeX) but perhaps that isn't possible.
Anyway, the result of test has a square root in the denominator that can be simplified
to get rid of the square root sign, and the numerator has a term out of which one
can factor something and then use a trig identity. I could not get Sage to do those things.

In general it is difficult to get Sage to do something to PART of a formula.
For example in sin(4*t) + sin(2*t), get Sage to apply a double angle formula to sin(4*t) so
everything comes out in trig functions of 2*t.