Logged In: YES

user_id=28849

Why is this wrong? If I differentiate the result, I get:

trigsimp(diff(%,x));

(%o35) -(sqrt(2)*sin(x)^2-2*sqrt(2)*cos(x)-2*sqrt(2))

/((cos(x)+1)*sqrt(2*cos(x)+2))

(%i36) factor(%);

(%o36) -(sin(x)^2-2*cos(x)-2)/(cos(x)+1)^(3/2)

(%i37) ev(%,sin(x)^2=1-cos(x)^2);

(%o37) -(-cos(x)^2-2*cos(x)-1)/(cos(x)+1)^(3/2)

(%i38) factor(%);

(%o38) sqrt(cos(x)+1)