Why doesn't this work?
(1 - Tan[x])/(Sin[x] - Cos[x]) /. Tan[x] -> Sin[x]/Cos[x] I get back:
(* (1 - Tan[x])/(-Cos[x] + Sin[x]) *) I also tried:
(1 - Tan[x])/(Sin[x] - Cos[x]) /. {Tan[x] -> Sin[x]/Cos[x]} Got the same reply.
I also tried:
(1 - Tan[x])/(Sin[x] - Cos[x]) /. Tan[x] -> (Sin[x]/Cos[x]) Still got the same answer.
And though this is an incorrect substitution, it works:
(1 - Tan[x])/(Sin[x] - Cos[x]) /. Tan[x] -> Sin[x] + Cos[x] Update: Ok, here is what I tried using suggestions from folks below. I started with:
(1 - tan[x])/(sin[x] - cos[x]) /. tan[x] -> sin[x]/cos[x] Which gave me:
(* (1 - sin[x]/cos[x])/(-cos[x] + sin[x]) *) Then:
List @@ % Which gave me:
(* {1/(-cos[x] + sin[x]), 1 - sin[x]/cos[x]} *) Then I multiplied numerator and denominator by cos[x]:
%*{1/cos[x], cos[x]} Which gave me:
(* {1/(cos[x] (-cos[x] + sin[x])), cos[x] (1 - sin[x]/cos[x])} *) Then I did an expand:
% // Expand Which gave me:
(* {1/(cos[x] (-cos[x] + sin[x])), cos[x] - sin[x]} *) I was surprised that the denominator (first element in list) did not expand. Next:
Times @@ % Which gave me:
(* (cos[x] - sin[x])/(cos[x] (-cos[x] + sin[x])) *) Then:
% // Cancel Which gave me:
(* -(1/cos[x]) *) Then:
% /. cos[x] -> Cos[x] Which gave me a final answer:
(* -Sec[x] *) I actually didn't use the % sign. Rather, I used Shift-Cmd-L (Shift-Ctrl-L on Windows) to replay the output of the previous step, but thought that would crowd things a bit if I put it in here.
Interesting. How would other folks handle this process? It would be interesting to hear.
Tan -> (Sin[#]/Cos[#] &). $\endgroup$(1 - Tan[x])/(Sin[x] - Cos[x]) // Simplifygives-Sec[x]. $\endgroup$Sin[x]/Cos[x]toTan[x]. If you're going to do step-by-step math, perhaps consider using undefined symbols likesin[x]andcos[x]. $\endgroup$Activate[]/Inactivate[]here. $\endgroup$