Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!flph199.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!nlpi066.nbdc.sbc.com.POSTED!ffbda4aa!not-for-mail
Reply-To: "Nasser Abbasi" <nma@12000.org>
From: "Nasser Abbasi" <nma@12000.org>
Newsgroups: comp.soft-sys.matlab
References: <gv9t5p$qk1$1@fred.mathworks.com>
Subject: Re: Problem with Symbolic Math
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
Message-ID: <dC1Sl.30797$YU2.14884@nlpi066.nbdc.sbc.com>
NNTP-Posting-Host: 75.22.42.194
X-Complaints-To: abuse@prodigy.net
X-Trace: nlpi066.nbdc.sbc.com 1243129353 ST000 75.22.42.194 (Sat, 23 May 2009 21:42:33 EDT)
NNTP-Posting-Date: Sat, 23 May 2009 21:42:33 EDT
Organization: at&t http://my.att.net/
X-UserInfo1: [[PAPDON[ZRUS_ASZP^D]VDBAZOZ@GXOXZ\@LWQHBATBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN
Date: Sat, 23 May 2009 18:42:29 -0700
Xref: news.mathworks.com comp.soft-sys.matlab:542091



"Good " <modeebuo@yahoo.co.uk> wrote in message 
news:gv9t5p$qk1$1@fred.mathworks.com...
> Hi Friends,
> This problem is to be solved by symbolic math but the solution it gives me 
> does not tally with what the actual solution should be:
>
> The problem is to integrate a symbolic function of x, y, w and t with 
> respect to x and evaluate the integrand from -pi/2 to pi/2. So the code 
> below was written:
>
> syms N x y w t real
> A = N*cos(x-y)*cos(w*t-y);
> B = int(A, x, -pi/2, pi/2);
>
> The expected solution is:
>
> B should equal    N*sin(x-y)*cos(w*t-y) evaluated at (x=pi/2) minus  same 
> expression evaluated at (x=-pi/2). Naturally, the final solution should 
> be:
>
> B = N*(sin(pi/2-y) - sin(-pi/2-y))*cos(w*t-y) = 2*N*cos(y)*cos(w*t-y).
>
> Symbolic toolbox gives me:
>
> B = N*cos(-w*t+2*y)+N*cos(w*t)
>
> I cannot see how this solution is correct.
>
> Please I need this clarified so as to continue using this wonderful tool.

EDU>> syms N x y w t real
EDU>> B1 =  2*N*cos(y)*cos(w*t-y)
EDU>> B2 = N*cos(-w*t+2*y)+N*cos(w*t)

EDU>> simplify(B1-B2)

ans =

0

--Nasser