Roger,
Thank you very much.
David Egolf
"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <icuqt2$84v$1@fred.mathworks.com>...
> "David Egolf" <degolf@uidaho.edu> wrote in message <icunan$lrd$1@fred.mathworks.com>...
> > I'm having a problem with the "igrand" statement in Matlab's Symbolic Math toolbox. For example, please refer to the following two programs that I copied and pasted from my "m" files. The only difference between these two programs is that, in the
> > integrand, the coefficients R1=c1, R2=c2/2, and R3=c3/3. I ran both programs, then made the substitutions indicated in the previous sentence by hand. But the two solutions are different by 1/2*log(6) = 0.896. Am I doing something wrong or is the Symbolic Math "igrand" statement screwed up? I hope somebody can set me straight. My direct email address is <degolf@uidaho.edu>.
> > Thanks,
> > David Egolf
> >
> > %
> > % LK_Integration_Using R_Coefficients_Nov_2_2010
> > clear all
> > syms F R1 R2 R3
> > igrand = 1./((R1).*(1(F))+(R2).*(1(F.^2))+(R3).*(1(F.^3)))
> > y = int(igrand,F)
> > ys = simple(y)
> > %
> >
> > %
> > % LK_Integration_Using_C_Coefficients_Nov_9_2010
> > clear all
> > syms F c1 c2 c3
> > igrand = 1./(c1+(c2./2)+(c3./3)((c1).*(F))((c2./2).*(F.^2))((c3./3)...
> > .*(F.^3)))
> > y = int(igrand,F)
> > ys = simple(y)
> > %
>        
> Here you are using the 'int' function to find indefinite integrals, and there is no canonically unique answer to an indefinite integral. Therefore the symbolic toolbox is only restricted in its answer up to an arbitrary added constant. Whatever the inscrutable procedures 'int' has used on these two examples it has somehow managed to have different added constants for the differing expressions.
>
> The same thing happens frequently to calculus students finding indefinite integrals. One student's solution may different by a constant from another's because they have used different methods even though each was correct. You need to give 'int' the same leeway.
>
> Roger Stafford
