Piecewise functions in CAS

mikkelstouby shared this idea 8 years ago
Answered

Dear developers


It would be really nice if something like this would work in CAS-view:


g(x):=If[-4<=x<=5,x-1,If[5<x<=7,2x-7]]

Solve[g(x)=-4]


Also it would be nice if piecewise functions were typeset like in the algebra-view.


Regards,

Mikkel

Comments (3)

photo
1

We won't be able to get that working for Solve, but it (almost) works for NSolve, eg

    NSolve[(If[3 < x < 4,x,x+1])=3.5]

    NSolve[If[-4<=x<=5,x-1,If[5<x<=7,2x-7,10000000000]]=-4]

photo
1

    NSolve[If[-4<=x<=5,x-1,If[5<x<=7,2x-7]]=-4]


works in 5.0.30.0

photo
1

Wow, thanks!

© 2023 International GeoGebra Institute