# IntegralBetween yields undefined result

Niek Sprakel shared this question 4 years ago

Hi.

When I was playing around a bit with the IntegralBetween function, I've noticed that

it sometimes yields unexpected results. For instance here:

GeoGebra is happy to compute the integral with limits from -2 to -1/2, but when I try to

compute the integral with limits from 1/2 to 2, it yields "undefined".

Is this some kind of bug?

Kind regards and thanks in advance for any feedback, Niek

I guess that the result is related to your extensive use of floor function, that is semi-continuous.

Use the CAS view to compute it

Oh, sorry. I forgot to change the GUI language. It's the IntegralBetween command.

1

I guess that the result is related to your extensive use of floor function, that is semi-continuous.

Use the CAS view to compute it

Oh, sorry. I forgot to change the GUI language. It's the IntegralBetween command.

1

I see now that you are using GeoGebra Geometry. This app is meant for geometry applications, so doesn't have the CAS engine enabled.

1

Thanks.

When I use GeoGebra Classic though (version 6.0.529.0-w), it seems to make no difference when I open the same ggb file:

I'd like to avoid the floor function, but it seems a bit tricky to find some equivalent expression using

trigonometric functions.

Ah, I see it does work like this: "IntegralBetween(s,p_1,1/2,2,false)", at least to shade the area visually without computing the area numerically.

1

This works for the value if you need that:

`Integral(s(x)-p_1(x), 1 / 2, 2)`

2

Thanks, though I'm primarily interested in the visual pattern. Just to see if GeoGebra could be used to generate visual patterns like this Op Art from Bridget Riley:

https://i.imgur.com/QdxPAPk.jpg

1

You may find inequalities easier for that sort of thing, eg

```x^2+y^2<5 && x>1
```
(then line thickness -> 0)

1

Ah, that might be more convenient indeed, but somehow it doesn't let me rotate the sawtooth wave (probably because it's no longer a function under such a rotational transformation) expressed as an inequality.

https://i.imgur.com/eunyluG.png

1

Hmmm, I guess the most sensible way to obtain the desired results is to simply rotate the svg afterwards in InkScape.

I can't find any way to rotate the black shapes in GeoGebra.

1

Sadly, it seems that GeoGebra has some inherent limitations that seem to rule it out for generating visual patterns with high fidelity.

But perhaps I'm approaching it in the wrong way and GeoGebra can be more suitably used to generate the 3 basic constituent shapes and tiling them manually in InkScape on a hexagonal grid to obtain better results.

1

You can also use the Sequence() command to make such grids Sequence(Sequence(...

https://wiki.geogebra.org/e...

1

Yep, but I didn't see a way to do this such that I would still be able to customize the variations in the pattern. Perhaps a matrix could be used to specify these variations and then the nested Sequence command could obtain the cues from this matrix how to vary the pattern in the grid.

But even if this works and it would make it more convenient to generate the pattern (and perhaps keep GeoGebra nicely responsive because of a more compact formulation), this wouldn't resolve the lack of precision visible in the second screenshot of my previous comment.

1

```this wouldn't resolve the lack of precision
```

If you use a different method to draw the shapes (eg Curve() command) then Sequence(Sequence(Translate(... then I think it will be OK

1

I'll try some additional experiments to see if I can get GeoGebra to generate more precise results, but I've noticed that InkScape is reasonably convenient as well because shapes snap to a hexagonal grid, which makes it fairly easy to create patterns manually. It's also more intuitive if you can just move shapes around to tile them, but GeoGebra has potential to generate patterns mathematically or a more dynamic version where people can interact with the demonstration to vary the patterns.

This version was created in InkScape:

https://i.imgur.com/Aw1cVej.jpg

2

1

Great, thanks. That does indeed seem to yield high-fidelity patterns.