welding a piecewise function together at a point?

Mads Frederik Toft shared this question 6 months ago
Answered

Hi I have these two functions f(x) and g(x).

f(x) = If(-4 < x < 2, 1 / 2 x + 5)

g(x) =If(2 ≤ x, x² - 7x + 16)


They graphically touch each other x = 2, but I can only get the program to acknowledge this if I change f(x) = If(-4 <= x <= 2, 1 / 2 x + 5)

Any way (scriptwise) to force Geogebra to recognize that the functions do touch at the original condition for f eventhough f(x) = If(-4 < x < 2, 1 / 2 x + 5)??

Comments (10)

photo
1

Hi Mads!


The cut of the domains of f and g is empty.


In your first definition f has no value at x=2.

Greetings

mire2

photo
1

Why not defining both as a single piecewise function?


h(x) = If(-4 < x < 2, 1 / 2 x + 5, x ≥ 2, x² - 7x + 16)

photo
1

Because I need to test if f(j) = g(j) or f'(j) not equel g'(j) when j = 2.

So is that possible?

photo
1

Hi Mads! :smile:


Ok, another try. Yes, you can test it that way, but ...

f(j)=g(j) means, that j ∈ dom(f) ∩ dom(g) solving the equation

But in your given example dom(f) ∩ dom(g) = ∅, so there is no j solving the equation.


What you have to do is to proof if LimitBelow(f,2)==LimitAbove(g,2).


Edit: Hmm, that doesn't work, because the limits are "undefined", but with Simona's function h it works fine.

Greetings

mire2

photo
1

try a single piecewise function and LimitAbove( <Function>, <Value> ) LimitBelow( <Function>, <Value> )

photo
1

That should work in theory, but I define h(x), h(x) = If(-4 < x < 2, 1 / 2 x + 5, If(x ≥ 2, x² - 7x + 16))

Then the limit is undefined. But the graph is "connected" graphically at x = 2.


So what am I doing wrong?

photo
photo
1

the correct syntax is


h(x) = If(-4 < x < 2, 1 / 2 x + 5, x ≥ 2, x² - 7x + 16)

use it like in attached

Files: foro.ggb
photo
1

Many thanks for your answer, Sir :)


Then my final questionaire is if I want to test whether (1 / 2 x + 5)' and (x² - 7x + 16)' at x = 2 er different ? meaning


1 / 2 x + 5)' notequal (x² - 7x + 16)' ?? and (1 / 2 x + 5)==(x² - 7x + 16) ? At the given conditions.


Is that that possible?

photo
2

type h'(x) or derivative(h) then use limitabove(h',2) and limitbelow(h',2)

photo
1

Thank you Very much. Your input helped me get the bugs of out my "programming " :)

Have a nice day/evening where you are in the world :D

photo
© 2019 International GeoGebra Institute