Student Support Forum: 'Reduced question of last one' topicStudent Support Forum > General > "Reduced question of last one"

 < Previous Comment Help | Reply To Comment | Reply To Topic
 Author Comment/Response Nasser M. Abbasi 11/14/12 8:27pm Why the out put of: Simplify[Integrate[f[x, z] Sin[\[Theta]], {z, 0, 1}] - Sin[\[Theta]] Integrate[f[x, z] , {z, 0, 1}]] is not 0? How to let the out put=0? -------------------------------------------- Becuase f[x,z] is not defined, hence it could evaluate to anything. Hence integrand can be anything and Mathematica can't extract Sin[] out before hand. To force the simplication you want, you need to add an explicit rule to help Integrate. ------------------------------- Unprotect[Integrate]; Integrate[any_*f_,dom_]:=any*Integrate[f,dom]; Protect[Integrate]; Integrate[f[x,z] Sin[theta],{z,0,1}]-Sin[theta] Integrate[f[x,z],{z,0,1}] 0 -------------------------------- However, the above is not a robust thing as it stands (it can be made more robust, since if `any` happened to be a function of `z`, then you do not want that removed out from the integration. So, the above assumes that the multiplier inside the integrand does not depend on the integraion parameter. URL: ,

 Subject (listing for 'Reduced question of last one') Author Date Posted Reduced question of last one Xizheng 11/10/12 05:51am Re: Reduced question of last one Chenyu Lue 11/14/12 03:56am Re: Reduced question of last one Bill Simpson 11/14/12 6:17pm Re: Reduced question of last one Nasser M. Ab... 11/14/12 8:27pm
 < Previous Comment Help | Reply To Comment | Reply To Topic