4
$\begingroup$

So for the function (x^3 + 2)/(x^4 + 1) I needed to find the values where it is increasing and decreasing. I used

Reduce[D[f[x], x] > 0, x] // N

to find where it is increasing. Then I used

Reduce[D[f[x], x] < 0, x] // N

to find where it is decreasing. When I run that code I get

-2.11198 < x < 0. || 0. < x < 0.372591

and

x < -2.11198 || x > 0.372591

So my question is how do I turn those answers into coordinate pairs? To look like this: (-2.111985,0)∪(0,0.372591) and (-∞,-2.111985)∪(0.372691,∞)

$\endgroup$
5
$\begingroup$
sol1 = -2.11198 < x < 0. || 0. < x < 0.372591;
sol2 = x < -2.11198 || x > 0.372591;

region1 = List @@ (ImplicitRegion[#, x] & /@ sol1);
region2 = List @@ (ImplicitRegion[#, x] & /@ sol2);

rb1 = First @ RegionBounds[#]& /@ region1

{{-2.11198, 0.}, {0., 0.372591}}

rb2 = First @ RegionBounds[#]& /@ region2

{{-∞, -2.11198}, {0.372591, ∞}}

For displaying in the desired form:

HoldForm[# \[Union] #2]& @@ rb1

{-2.11198, 0.} ⋃ {0., 0.372591}

or

Infix[foo @@ rb1, "\[Union]"]

{-2.11198, 0.} ⋃ {0., 0.372591}

Similarly, for rb2:

HoldForm[# \[Union] #2]& @@ rb1

{-∞, -2.11198} ⋃ {0.372591, -∞}

Infix[foo @@ rb2, "\[Union]"]

{-∞, -2.11198} ⋃ {0.372591, -∞}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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