Re: Problem with Integration
- To: mathgroup at smc.vnet.net
- Subject: [mg22542] Re: Problem with Integration
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Thu, 9 Mar 2000 03:24:27 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <8a53ai$dln@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, > > In[1]:= U[f_]:=1.0*Integrate[Cos[(f*Pi)/(180*2) + alpha],{alpha,-(Pi/3), Pi/3}] this is not a good idea, because than for every f the symbolic integration is called but it need only be done once. > > In[2]:= U[60] > > -16 > Out[2]= 1.5 - 6.08617 10 I > > In[3]:= Integrate[Cos[(f*Pi)/(180*2) + alpha],{alpha, -(Pi/3), Pi/3}] > > f Pi > Out[3]= Sqrt[3] Cos[----] > 360 > > Cos[f Pi/360] should be real vor any real f. How can I avoid results > like Out[2] (exepct using Chop[] or Re[])? > > Hans Friedrich Steffani > rhs = Integrate[Cos[(f*Pi)/(180*2) + alpha], {alpha, -(Pi/3), Pi/3}] U = Function[f, Evaluate[rhs]] and U[60] work as expected. Hope that helps Jens