Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Considering I have three functions

f1 = -x + 1;

f2 = x - 1;

f3 = x + 3;

How can I find the intersection points of this functions? Thanks.

This didn't work

t = Solve[{k \[Element] f1, k \[Element] f2}, {k}]
share|improve this question

3 Answers 3

up vote 3 down vote accepted

Here it is an overkill but maybe for general context it is worth to say this.

It does not work because fs are not regions:

f1 = ImplicitRegion[{y == -x + 1}, {x, y}]
f2 = ImplicitRegion[{y == x - 1}, {x, y}]

Solve[{k \[Element] f1, k \[Element] f2}, {k}]
{{k -> {1, 0}}}

I said an overkill because people usually do something like:

Solve[{y == -x + 1, y == x - 1}, {x, y}]
{{x -> 1, y -> 0}}
share|improve this answer

Use Solve the neat way (and see here):

Solve[{f1 == f2}, x]
{*
{x -> 1}
*}
Solve[{f1 == f3}, x]
{*
{x -> -1}
*}

Plot[{f1, f2, f3}, {x, -5, 5}, PlotLegends -> "Expressions", 
Epilog -> {Red, PointSize[Large], Point[{{1, 0}, {-1, 2}}]}]

enter image description here

share|improve this answer
Solve[{y == 1 - x, y == x - 1}, {x, y}]
Solve[{y == 1 - x, y == x + 3}, {x, y}]

seems the simplest approach. Another "overkill" region approach:

l1 = InfiniteLine[{{0, 1}, {1, 0}}];
l2 = InfiniteLine[{{0, -1}, {1, 0}}];
l3 = InfiniteLine[{{0, 3}, {1, 4}}];
ri1 = RegionIntersection[l1, l2];
ri2 = RegionIntersection[l1, l3];
Reduce[RegionMember[ri1, {x, y}]]
Reduce[RegionMember[ri2, {x, y}]]

yield y == 0 && x == 1 and y == 2 && x == -1 respectively

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.