# FindRoot and two Parametric Functions

**URL:** <https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610>\
**Category:** Questions\
**Tags:** mathematica, calculus\
**Created:** [January 24, 2015, 12:58am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610 "2015-01-24T00:58:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![desm7153](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@desm7153](https://community.wolfram.com/u/desm7153)\
**Post date:** [January 24, 2015, 12:58am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/1 "2015-01-24T00:58:21Z")

</div>

I am trying to find the three intersection points of r1[t\_] = {2 Cos[t], 2 Sin[t]} and r2[t\_] = {3 Cos[t], Sin[t] - 1} using FindRoot but keep getting various error messages no matter what I do. Any help is appreciated. Also, I would like to designate them both as the same variable but give them different colors using PlotStyle. Currently I am only able to do so by designating them as two separate variables. I am new to mathematica so please be as basic as possible. Code is attached.

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [January 24, 2015, 1:57am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/2 "2015-01-24T01:57:35Z")

</div>

The value of t in r1 is not the same as the value of t in r2 when the curves intersect. Here’s one way to find the intersections:

```
In[1]:= r1[t_] = {2 Cos[t], 2 Sin[t]};

In[2]:= r2[t_] = {3 Cos[t], Sin[t] - 1};

In[17]:= r = 
 Reduce[{r1[t1] == r2[t2], 0 <= t1 <= 2 \[Pi], 
   0 <= t2 <= 2 \[Pi]}, {t1, t2}]

Out[17]= (t1 == (3 \[Pi])/2 && 
   t2 == (3 \[Pi])/2) || (t1 == 2 \[Pi] - 2 ArcTan[8 - 3 Sqrt[7]] && 
   t2 == 2 ArcTan[(-53 + 20 Sqrt[7])/(3 (-8 + 3 Sqrt[7]))]) || (t1 == 
    2 \[Pi] - 2 ArcTan[8 + 3 Sqrt[7]] && 
   t2 == 2 ArcTan[(53 + 20 Sqrt[7])/(3 (8 + 3 Sqrt[7]))])

In[23]:= r1[t1] /. {ToRules[r]}

Out[23]= {{0, -2}, {2 Cos[2 ArcTan[8 - 3 Sqrt[7]]], -2 Sin[
    2 ArcTan[8 - 3 Sqrt[7]]]}, {2 Cos[
    2 ArcTan[8 + 3 Sqrt[7]]], -2 Sin[2 ArcTan[8 + 3 Sqrt[7]]]}}

In[24]:= N[%]

Out[24]= {{0., -2.}, {1.98431, -0.25}, {-1.98431, -0.25}}

```

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [January 24, 2015, 2:01am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/3 "2015-01-24T02:01:49Z")

</div>

Since we want the intersection of the curves, we do not require t to be the same for each at the intersections. And the equality is really 2 equations, in x and y, so we need 2 independent variables. (Although Reduce or FindInstance would find the point where intersection occurs at t1 = t2.)

```
r1[t_] = {2 Cos[t], 2 Sin[t]};

r2[t_] = {3 Cos[t], Sin[t] - 1};

(* there are 2 independent variables *)
(* C[_]\[Rule]0 chhoses the principal solutions *)
sol = Solve[r1[t1] == r2[t2] // Evaluate, {t1, t2}] /. C[_] -> 0

(* {{t1\[Rule]-(\[Pi]/2),t2\[Rule]-(\[Pi]/2)},{t1\[Rule]-ArcTan[1/(3 \
Sqrt[7])],t2\[Rule]ArcTan[3/Sqrt[7]]},{t1\[Rule]-\[Pi]+ArcTan[1/(3 \
Sqrt[7])],t2\[Rule]\[Pi]-ArcTan[3/Sqrt[7]]}} *)

(* solution points *)
points = Point /@ {r1[t1], r2[t2]} /. sol // Flatten;

(* plot with solutions *)
parplot2 = 
 ParametricPlot[{r1[t], r2[t]}, {t, 0, 2 \[Pi]}, 
  PlotStyle -> {{Red, Thick}, {Blue, Thick}}, 
  Epilog -> {PointSize[.02], points}]

```

 ![disscussionhelp.png](https://global.discourse-cdn.com/wolfram/original/2X/a/ad632feb907da5b50d542adcfc1a55737811bd80.png)

---

<div class="post-metadata">

**Author:** ![dlkeith](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dlkeith/32/31494_2.png) [@dlkeith](https://community.wolfram.com/u/dlkeith)\
**Post date:** [January 24, 2015, 2:10am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/4 "2015-01-24T02:10:05Z")

</div>

Apparently neither one of us has much to do on a Friday night. 😉

---

<div class="post-metadata">

**Author:** ![fkampas](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/fkampas/32/41217_2.png) [@fkampas](https://community.wolfram.com/u/fkampas)\
**Post date:** [January 24, 2015, 2:18am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/5 "2015-01-24T02:18:16Z")

</div>

I suppose we’re confirming the stereotypes put forth on “The Big Bang Theory” about physicists.

---

<div class="post-metadata">

**Author:** ![desm7153](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@desm7153](https://community.wolfram.com/u/desm7153)\
**Post date:** [January 24, 2015, 4:15am UTC](https://community.wolfram.com/t/findroot-and-two-parametric-functions/4610/6 "2015-01-24T04:15:18Z")

</div>

Thanks guys!
