# How to derive trigonometric Cartesian equation from parametric

How can one derive programmatically a Cartesian equation when $$x$$ and $$y$$ are parametrically represented by trigonometric functions?

i.e.: Given that $$x= \cos(2 t)$$, and $$y = -\sin(t)$$, how can I find the Cartesian equation in terms of $$x$$, and also in terms of $$y$$?

{
x == Cos[2 t],
y == -Sin[t]
}

• Hi @wendy, notice how you questions always get edited by other users to provide the necessary code and maths in formatted form and make the questions title and text descriptive and searchable. In the future you can try to do that while you compose your question. See here: mathematica.stackexchange.com/help/on-topic – rhermans Aug 2 '19 at 12:27
• Hi @rhermans , yes, I do notice that my questions always get edited. I'm sorry it always happens, and for burdening you/ those who go through the effort of editing them. Although I always keep in mind I should format it properly, when I post another question, I'm in such a state of panic I don't format it, and I realise once it's posted that I should have. I really apologise. – wendy Aug 2 '19 at 12:39
• No need to apologize, you are just starting and getting acquainted with the site. Just keep it in mind for the future. You can always edit your question after posting to improve it. By doing all this you help us to help you and likely you will inspire great answers. The site depends on participation, as you receive give back: vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. – rhermans Aug 2 '19 at 12:41
• Duely noted, @rhermans ! Thanks again for answering my question and for editing it – wendy Aug 2 '19 at 12:52

One can use GroebnerBasis[] with some assistance from TrigExpand[]:

GroebnerBasis[{x == Cos[2 t], y == -Sin[t]} // TrigExpand
// Append[Cos[t]^2 + Sin[t]^2 == 1], {x, y}, {Cos[t], Sin[t]}] // First
-1 + x + 2 y^2


Check:

% /. Thread[{x, y} -> {Cos[2 t], -Sin[t]}] // Simplify
0

• Hello, @J.M., thanks for your contribution. As much as I appreciate your suggestion, I'm confused as to how it works, and would love to know. Could you please explain what a GrobnerBasis is? What is your "Check" step doing? What does the "% /. Thread" mean/do? Many thanks in advance – wendy Aug 2 '19 at 12:48
• Ulrich has already explained the Weierstrass substitution to you. Here, I use GroebnerBasis[] to help me eliminate the terms with Cos[t] and Sin[t] (which is why they are in the third argument), and retain an expression only in terms of x and y. The "check" ensures that the original parametric equations give $0$ when substituted into the resulting implicit Cartesian equation previously (hence the %) produced by GroebnerBasis[]. – J. M. is in limbo Aug 6 '19 at 3:30

If you need to go blindly, then have a look into the documentation of Eliminate, TrigExpandand Solve, and beware of the limitation of InverseFunction when solving into the form $$y=f(x)$$.

There are other better options (see answers by Ulrich Neumann and J.M) if you know where you are going.

Assuming[
-1 < x < 1,
Simplify@Eliminate[
{
x == Cos[2 t],
y == -Sin[t]
}
, t
]]

(* ArcCos[x] + 2 ArcSin[y] == 0 *)

Assuming[
0 < x < 1,
FullSimplify[
Solve[
ArcCos[x] + 2 ArcSin[y] == 0
, y
]]]
(* {{y -> -Sin[ArcCos[x]/2]}} *)


or

Eliminate[
TrigExpand@{
x == Cos[2 t],
y == -Sin[t]
}, t]

(* 2 y^2 == 1 - x *)


And then Solve.

• You can help out Eliminate[] by performing a preliminary Weierstrass substitution: Eliminate[TrigExpand[{x == Cos[2 t], y == -Sin[t]} /. t -> 2 ArcTan[u]], u] – J. M. is in limbo Aug 2 '19 at 11:54
• Thanks @J.M.isaway, good to see you back! – rhermans Aug 2 '19 at 12:28
• Thank you @rhermans ! – wendy Aug 2 '19 at 12:43
• Thanks for your suggestion, @J.M.isaway ! Do you mind if you explain what a "Weierstrass substitution" is please? – wendy Aug 2 '19 at 12:44
• I am always amazed that Eliminate handles transcendentals, even simple ones like this. I was probably a lot smarter when i got it to do that (way back in the last millennium). – Daniel Lichtblau Aug 2 '19 at 16:08

The "Weierstrass substitution" gives a direct result

eq = { x == Cos[2 t], y == -Sin[t]} /. t -> 2 ArcTan[u] // TrigExpand
sol = Solve[eq, y, u]
(*{{y -> -(Sqrt[1 - x]/Sqrt)}, {y -> Sqrt[1 - x]/Sqrt}}*)

Plot[y /. sol, {x, -1, 1}, Evaluated -> True] • Hi, @UlrichNeumann , thanks for your comment. Could you please explain what a "Weierstrass substitution" is? Why did you do it? – wendy Aug 2 '19 at 12:45
• @wendy It is the simple transformation u->Tan[t/2]<=> t->2 ArcTan[u] which transforms your trigonometric equations into rational equations in u, which might be solved easier. Additionally you restrict the solution to Pi <t<Pi – Ulrich Neumann Aug 2 '19 at 12:56
• Because you avoid Sqrt and u=Tan[t/2] transforms one period -Pi<t<Pi to -Infinity<u<Infinity – Ulrich Neumann Aug 4 '19 at 12:35
• Sqrt =squarerootfunction. – Ulrich Neumann Aug 4 '19 at 13:07
• Try it yourself {Sin[t], Cos[t], Tan[t]} /. t -> 2 ArcTan[u] // TrigExpand // Simplify – Ulrich Neumann Aug 4 '19 at 13:08

If you want to avoid inverse functions then you need to use trig identities to eliminate the parameter (if that is possible). For the example that you give,

x == Cos[2t] //TrigExpand
% /. Cos[t]^2 -> 1 - Sin[t]^2
% /. Sin[t] -> -y

(*  x == 1 - 2 y^2  *)


so the curve is part of a parabola on its side,

ParametricPlot[Evaluate[{x, y} /. {x -> Cos[2 t], y -> -Sin[t]}], {t, 0, 10}]


More generally, one would have to proceed as in @rhermans answer.

• I'm very grateful for your comment, @AndrewNotron. Thank you. Do you mind if you please explain what the second line onwards means/ does? Thank you – wendy Aug 2 '19 at 12:59
• % is the last Output result, /. is infix form of ReplaceAll, -> is infix form of Rule. To find out this sort of thing, highlight the %, /., or -> with the mouse and then press the F1 key to get the documentation. – Andrew Norton Aug 3 '19 at 1:46