0% found this document useful (0 votes)
42 views10 pages

CCC CC Ô ÔÔ

The document contains the output of multiple symbolic differentiation operations in MATLAB. Various symbolic expressions are defined and their derivatives are calculated. Errors occur in some cases due to incorrect syntax in defining the symbolic expressions. The document demonstrates how to take derivatives of a variety of functions, including polynomials, rational functions, and expressions with parameters, using the symbolic differentiation capabilities in MATLAB.

Uploaded by

israel_Vzf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views10 pages

CCC CC Ô ÔÔ

The document contains the output of multiple symbolic differentiation operations in MATLAB. Various symbolic expressions are defined and their derivatives are calculated. Errors occur in some cases due to incorrect syntax in defining the symbolic expressions. The document demonstrates how to take derivatives of a variety of functions, including polynomials, rational functions, and expressions with parameters, using the symbolic differentiation capabilities in MATLAB.

Uploaded by

israel_Vzf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

>> a=sym('(2-3*x)') 382

Error: 'expression' expected

a= [line 1, col 5]

(2-3*x) Error in ==>

sym.sym>sym.sym/char2sym at 337

>> diff(a) Scell =

scalarsym(x);

ans =

Error in ==>

-3 sym.sym>sym.sym/symchar at 182

Scell =

>> b=sym('(mx+b)') char2sym(x);

b= Error in ==> sym.sym>sym.sym at

120

(mx+b) S=

cell2sym(S,symchar(x,a,nargin));

>> diff(b) >> c=sym('(ax^2)')

ans = c=

1 (ax^2)

>> c=sym('(ax^^)') >> diff(c)

??? Error using ==>

sym.sym>sym.sym/scalarsym at ans =
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

>> e=sym('(3*x-x^3)')

2*ax

e=

>> c=sym('(2*t-t^2)')

(3*x-x^3)

c=

>> diff(e)

(2*t-t^2)

ans =

>> diff(c)

3 - 3*x^2

ans =

>> f=sym('(4*u^2+2*u^3)')

2 - 2*t

f=

>> d=sym('(cx^3)')

(4*u^2+2*u^3)

d=

>> diff(f)

(cx^3)

ans =

>> diff(d)

6*u^2 + 8*u

ans =

>> g=sym('(x^4)')

3*cx^2

g=
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

>> diff(i)

(x^4)

ans =

>> diff(g)

-6/x^3

ans =

>> j=sym('(t+4/t)')

4*x^3

j=

>> h=sym('(2/o+1)')

(t+4/t)

h=

>> diff(j)

(2/o+1)

ans =

>> diff(h)

1 - 4/t^2

ans =

>> k=sym('(1/1-2*x)')

-2/o^2

k=

>> i=sym('(3/x^2+2)')

(1/1-2*x)

i=

>> diff(k)

(3/x^2+2)

ans =
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

>> n=sym('(x^3+1/x)')

-2

n=

>> l=sym('(x/x+2)')

(x^3+1/x)

l=

>> diff(n)

(x/x+2)

ans =

>> diff(l)

3*x^2 - 1/x^2

ans =

>> o=sym('(1/x^2+a^2)')

o=

>> m=sym('(At+B/Ct+D)')

(1/x^2+a^2)

m=

>> diff(o)

(At+B/Ct+D)

ans =

>> diff(m)

-2/x^3

ans =

>> p=sym('(x/x^2+1)')

-B/Ct^2

p=
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

>> diff(r)

(x/x^2+1)

ans =

>> diff(p)

6*x + 4

ans =

>> s=sym('(at^)')

-1/x^2 ??? Error using ==>

sym.sym>sym.sym/scalarsym at

>> q=sym('(x^2/4-x^2)') 382

Error: 'expression' expected

q= [line 1, col 5]

(x^2/4-x^2) Error in ==>

sym.sym>sym.sym/char2sym at

>> diff(q) 337

Scell =

ans = scalarsym(x);

-(3*x)/2 Error in ==>

sym.sym>sym.sym/symchar at

>> r=sym('(3*x^2+4*x-5)') 182

Scell =

r= char2sym(x);

(3*x^2+4*x-5) Error in ==> sym.sym>sym.sym

at 120
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

S=

cell2sym(S,symchar(x,a,nargin)); ans =

>> s=sym('(at^2+bt+c)')

6*u^2 - 6*u

s=

>> u=sym('(ax^3+bx^2+cx+d)')

(at^2+bt+c)

u=

>> diff(s)

(ax^3+bx^2+cx+d)

ans =

>> diff(u)

ans =

>> t=sym('(at^2+bt+c)')

t=

>> v=sym('(a-bx)^2')

(at^2+bt+c)

v=

>> t=sym('(2*u^3-3*u^2)')

(a-bx)^2

t=

>> diff(v)

(2*u^3-3*u^2)

ans =

>> diff(t)
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

2*bx - 2*a Error in ==>

sym.sym>sym.sym/symchar at

>> w=sym('(2-x)*(1-2*x)') 182

Scell =

w= char2sym(x);

(2-x)*(1-2*x) Error in ==> sym.sym>sym.sym

at 120

>> diff(w) S=

cell2sym(S,symchar(x,a,nargin));

ans = >> x=sym('(Ax+B)*(Cx+D)')

??? Error using ==>

4*x - 5 sym.sym>sym.sym/scalarsym at

382

>> x=sym('(Ax+B)(Cx+D)') Error: Illegal operand

??? Error using ==> [_plus]

sym.sym>sym.sym/scalarsym at

382 Error in ==>

Error: Illegal operand sym.sym>sym.sym/char2sym at

[_plus] 337

Scell =

Error in ==> scalarsym(x);

sym.sym>sym.sym/char2sym at

337 Error in ==>

Scell = sym.sym>sym.sym/symchar at

scalarsym(x); 182

Scell =
ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

char2sym(x); S=

cell2sym(S,symchar(x,a,nargin));

Error in ==> sym.sym>sym.sym >> x=sym('(A*x+B)*(C*x+D)')

at 120

S= x=

cell2sym(S,symchar(x,a,nargin));

>> x=sym('(Ax+B)*(Cx+D)') (A*x+B)*(C*x+D)

??? Error using ==>

sym.sym>sym.sym/scalarsym at >> diff(x)

382

Error: Illegal operand ans =

[_plus]

A*(C*x + D) + C*(B + A*x)

Error in ==>

sym.sym>sym.sym/char2sym at >> y=sym('(a+bt)^3')

337

Scell = y=

scalarsym(x);

(a+bt)^3

Error in ==>

sym.sym>sym.sym/symchar at >> diff(y)

182

Scell = ans =

char2sym(x);

3*(a + bt)^2

Error in ==> sym.sym>sym.sym

at 120 >> z=sym('(x/a+bx^2')


ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

??? Error using ==> col 11]

sym.sym>sym.sym/scalarsym at

382 Error in ==>

Error: ')' expected [line 1, sym.sym>sym.sym/char2sym at

col 10] 337

Scell =

Error in ==> scalarsym(x);

sym.sym>sym.sym/char2sym at

337 Error in ==>

Scell = sym.sym>sym.sym/symchar at

scalarsym(x); 182

Scell =

Error in ==> char2sym(x);

sym.sym>sym.sym/symchar at

182 Error in ==> sym.sym>sym.sym

Scell = at 120

char2sym(x); S=

cell2sym(S,symchar(x,a,nargin));

Error in ==> sym.sym>sym.sym >> z=sym('(x/a+bx^2)')

at 120

S= z=

cell2sym(S,symchar(x,a,nargin));

>> z=sym('(x/a+b*x^2') (x/a+bx^2)

??? Error using ==>

sym.sym>sym.sym/scalarsym at >> diff(z)

382

Error: ')' expected [line 1, ans =


ADRIAN ISRAEL LOPEZ VILLEGAS IMA 201 V 09/12/2021

1/a

>> a=sym('(a+bx^2/x^2)')

a=

(a+bx^2/x^2)

>> diff(a)

ans =

-(2*bx^2)/x^3

>> b=sym('(x^2/a+bx^2)')

b=

(x^2/a+bx^2)

>> diff(b)

ans =

(2*x)/a

You might also like