On Mon, Jul 24, 2023 at 05:12:37PM +0000, '68th' via FriCAS - computer algebra system wrote: > ------- Original Message ------- > On Sunday, July 23rd, 2023 at 8:36 PM, Waldek Hebisch > <de...@fricas.math.uni.wroc.pl> wrote: > > > )trace INTEF )math > > Can ')trace' be somehow used for 'normalize' to see its intermediate steps?
Try )trace EFSTRUC )math But you will see that there are two steps, one transforms function to standard form, for example expressing trignomentric functions in terms of tangents, and the second one i normalization proper. You will get more info using )trace LINDEP )math For example, normalize(exp(2*x) - exp(x)^2) tries to find linear dependence over integrs between 1 and 2. But trace does not say why this system? Well, the rule is: look arguments of all expnential and logaritms which appear in your expression. In this case you get exp(x) and exp(2*x) as exponentials and there are no logratims. Arguments of exponentials are x and 2x. Then we form derivatives of arguments, that is 1 and 2 and we try to find releation over integers. Well, 2*1 = 2. From this we infer that exp(2*x)/exp(x)^2 is a constant, if fact 1. So we replace exp(2*x) by exp(x)^2 and we get exp(x)^2 - exp(x)^2 that is zero (internally replacement and simplifiaction is done together. Note that things like EFSTRUC or LINDEP are abbreviations, FriCAS hyperdoc browse command or )show command show that full name is ElementaryFunctionStructurePackage. From browse you can go to source and see what each function is doing. > > Theory says that this is simplest possible expression > > of similar form. > > That's not how I found the simpler antiderivative. I don't use complex > exponential functions. It only takes a right u-substitution. But in general substitutions are hard to find. Expressing trigonometic functions in terms of complex exponential is much easier (purely mechanical). > > But in this case it does not work. > > Okay, FriCAS magic doesn't work. The question is: is it still possible to > make FriCAS find the simpler antiderivative? Can a user have any control over > the integration process? Let's say: > > u := l/k*tan(gamma/2) > > If I will be able to do all the necessary transformation to the integrand, > can I then use u as the second argument in the 'integrate' command? Well, you can do substitution, pass that to integrate and do backsubstitution. But 'integrate' is an algorithm, it dully performs all its steps. And FriCAS gives you warranty that when there are no algebraics and antiderivative is elementary than FriCAS will find an antiderivative. If you deviate from prescribed steps, then there is no such warranty, So FriCAS can not allow variation for elementary integrals. Once integral is determined to be nonelementry, than there is some possibility for variation. But there is another aspect: allowing more things internally means more code in integrator. For example, in the past FriCAS would handle your integral directly in terms of tangent, whithout introducing complex numbers. I think that this version would automatically find equvalent of you substitution. Corresponding code was developed it the hope that working it terms of tangents would give better integrals. But while using tangents would give improvement, in other cases tangents lead to more complicated integration. On avergage complex transformation seem to give better results. So code for handling tangent was removed, it is better to improve/fix transformation stage. -- 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 fricas-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/ZL/l83pth4%2BBwLU4%40fricas.math.uni.wroc.pl.