Opened 4 years ago

Closed 3 years ago

# Error integrate with Fricas as algorithm fresnel_sin called

Reported by: Owned by: gh-nasser1 minor sage-duplicate/invalid/wontfix symbolics fricas, fresnel, integrate slelievre Frédéric Chapoton N/A

This ticket tracks the problem reported at

observed in SageMath 8.5.beta2:

```sage: from sympy import fresnelc, fresnels
sage: var('b x')
sage: integrate(x^7*fresnels(b*x), x, algorithm="fricas")
Traceback (most recent call last)
...
TypeError: An error occurred when FriCAS evaluated '((x)^(7))*(fresnel_sin((b)*(x)))':
There are no library operations named fresnel_sin
Use HyperDoc Browse or issue
)what op fresnel_sin
to learn if there is any operation containing " fresnel_sin " in its
name.

Cannot find a definition or applicable library operation named
fresnel_sin with argument type(s)
Polynomial(Integer)

Perhaps you should use "@" to indicate the required return type, or
"\$" to specify which version of the function you need.
```

FriCAS does not have `fresnel_sin` but has `fresnelS` and `fresnelC`:

When running the same command inside Fricas 1.3.4 itself, it works OK

```integrate(x^7*fresnelS(b*x),x)

(3)
2     2
5   2 5               b %pi x       8   4 8
(- 7 b %pi x  + 105 b x)sin(--------) + (b %pi x  - 105)fresnelS(b x)
2
+
2     2
7   3 7       3     3     b %pi x
(b %pi x  - 35 b %pi x )cos(--------)
2
/
8   4
8 b %pi
```

Why the error says when FriCAS evaluated '((x)(7))*(fresnel_sin((b)*(x)))' when Fricas itself does not have this function?

Notice that there is no problem using default integrate algorithm in Sage:

```sage: integrate(x^7*fresnels(b*x),x)
1/8*x^8*fresnel_sin(b*x) - 1/16*sqrt(1/2)*((105*I + 105)*(1/4)^(1/4)*pi*erf(sqrt(1/2*I*pi)*b*x) - (105*I - 105)*(1/4)^(1/4)*pi*erf(sqrt(-1/2*I*pi)*b*x) - 4*(sqrt(1/2)*pi^4*b^7*x^7 - 35*sqrt(1/2)*pi^2*b^3*x^3)*cos(1/2*pi*b^2*x^2) + 28*(sqrt(1/2)*pi^3*b^5*x^5 - 15*sqrt(1/2)*pi*b*x)*sin(1/2*pi*b^2*x^2))/(pi^5*b^8)
```

### comment:1 Changed 4 years ago by mantepse

I think that this was just fixed in #26746:

```sage: from sympy import fresnelc, fresnels
sage: var('a b c d e m n x ')
sage: integrate(x^7*fresnels(b*x),x,algorithm="fricas")
1/8*((pi^3*b^7*x^7 - 35*pi*b^3*x^3)*cos(1/2*pi*b^2*x^2) + (pi^4*b^8*x^8 - 105)*fresnel_sin(b*x) - 7*(pi^2*b^5*x^5 - 15*b*x)*sin(1/2*pi*b^2*x^2))/(pi^4*b^8)
```

### comment:2 Changed 4 years ago by mantepse

• Authors set to Martin Rubey
• Status changed from new to needs_review

### comment:3 Changed 4 years ago by mantepse

• Milestone changed from sage-8.5 to sage-duplicate/invalid/wontfix

### comment:4 Changed 4 years ago by chapoton

• Status changed from needs_review to positive_review

### comment:5 Changed 4 years ago by gh-nasser1

Thanks. This is confirmed fixed in

```SageMath version 8.5.beta5, Release Date: 2018-11-25
```

```sage: from sympy import fresnelc, fresnels
sage: var('a b c d e m n x ')
sage: integrate(x^7*fresnels(b*x),x,algorithm="fricas")

1/8*((pi^3*b^7*x^7 - 35*pi*b^3*x^3)*cos(1/2*pi*b^2*x^2) + (pi^4*b^8*x^8 - 105)*fresnel_sin(b*x) - 7*(pi^2*b^5*x^5 - 15*b*x)*sin(1/2*pi*b^2*x^2))/(pi^4*b^8)
sage:

```

### comment:6 Changed 3 years ago by slelievre

• Authors Martin Rubey deleted