Indeed :

```
sage: f(x)=2^(x-1/2*I*log(-e^(-2*I*pi*x))/pi-1/2)
```

The key is probably

```
sage: f(x).diff(x)
0
```

This should include an (infinite) series of terms in `dirac(x-k)` for k in 
integers...

Logical consequence :

```
sage: f(x).integrate(x)
1/2*sqrt(2)*(-1)^(-1/2*I*log(2)/pi)*x
```

That is, your antiderivative is the product of `x` by aconstant, which 
turns out to be :

```
sage: f(x).integrate(x)/x
1/2*sqrt(2)*(-1)^(-1/2*I*log(2)/pi)
sage: (f(x).integrate(x)/x).simplify()
1/2*sqrt(2)/(-1)^(1/2*I*log(2)/pi)
sage: (f(x).integrate(x)/x).simplify_full()
1
```

Note that `(2^floor(x)).integrate(x).plot((x,0,7/2))` gives :

[image: tmp_0qt8ouke.png]

which is correct. BTW :

```
sage: (2^floor(x)).integrate(x)
2^floor(x)*x
```


HTH,
Le samedi 21 janvier 2023 à 15:34:11 UTC+1, Georgi Guninski a écrit :

> I got an integral, which fails the derivative check.
>
> For real positive x, define
> f(x)=2^(x - 1/2*I*log(-e^(-2*I*pi*x))/pi - 1/2)
> f(x) is just an obfuscation of 2^floor(x) and
> for all positive x, f(x) is integer.
> Let g(x) be the indefinite integral of f(x)
> and let gder(x)=g'(x).
> Assuming correct computations, we should have
>
> gder(x)=g'(x)=f(x) (*)
>
> According to sage, gder is the constant $1$
> and (*) fails.
>
> sage session:
>
> ===
> f=2^(x - 1/2*I*log(-e^(-2*I*pi*x))/pi - 1/2)
> g=integrate(f,x);gder=g.derivative(x)
> g
> #1/2*sqrt(2)*(-1)^(-1/2*I*log(2)/pi)*x
> gder
> #1/2*sqrt(2)*(-1)^(-1/2*I*log(2)/pi)
> CC(gder)
> #1.00000000000000
> x0=5;CC((f-gder)(x=x0))
> #31.0000000000000
> ===
>
> Some questions:
> 1. What other CASes say about g(x)?
> 2. Why the derivative test fails?
> 3. Besides the jumps at integer, do branches of log()
> give instability?
>
> Some comments suggest discontinuous functions
> cause integral problems. There are built-in
> discontinuous functions like tan() which are
> widely used.
>
> 4. Why tan() integrals are used without problems (?)
> when this fails the derivative check?
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/0aa06411-e4e9-4485-a5e9-989cd2ea9327n%40googlegroups.com.

Reply via email to