On Wed, Jul 26, 2023 at 02:51:21PM +0000, '68th' via FriCAS - computer algebra 
system wrote:
> ------- Original Message -------
> On Tuesday, July 25th, 2023 at 3:10 PM, Waldek Hebisch 
> <[email protected]> wrote:
> 
> > Well, you can do substitution, pass that to integrate and do
> > backsubstitution.
> 
> If I do
> 
> u := l/k*tan(gamma/2)
> 
> then I can't use it in
> 
> integrate(1/(1+u^2),u)
> Cannot find a definition or applicable library operation named integrate with 
> argument type(s)
>  Expression(Integer)
>  Expression(Integer)
> 
> How to do u-substitution in FriCAS?

ex1 := (1+tan(gamma/2)^2)/(k^2+l^2*tan(gamma/2)^2)
d_subst := (k/l)*u
inv_subst := l/k*tan(gamma/2)
exs := subst(ex1/D(inv_subst, gamma), tan(gamma/2)= d_subst)
iis := integrate(exs, u)
subst(iis, u = inv_subst)

Note that you need to provide both direct substitution and an inverse
one.  And you can substitute only for kernels, that is things like
tan(x/2), exp(x^2), etc.  With that constraints commands above will
work for many substitutions.  You just need to give the kernel
(tan(gamma/2) in this case), new variable (u int this case),
direct substitution and inverse substitution.

As I wrote, when FriCAS thinks that substitutions are useful
it finds and applies them automatically.  In general equation
u = f(k) may be not solvable for k, but you can do substitutions
essentially via pattern matching.  In FriCAS this gets messy
because user would have to supply appropriate rewrite rules.

Still, the case above where we substitute for kernels and
both substitutions are give by formulas covers many important
special cases.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZMJjYFzNtv5rDSzV%40fricas.math.uni.wroc.pl.

Reply via email to