Calculus Intro: How to do differentiation using Julia Programming Language

Опубликовано: 26 Январь 2024
на канале: tondekush
152
6

import two libraries, i.e., calculus, symbolics
assign variables to string function
differentiate the functions
link to Maple video:    • How to solve mathematical calculus pr...  

Code:
a = "3*x^2 -2*x + log(x)"
b = "cos(x)*2*x"
f = "sin(2*x)"
g = "(2*x^3+ 4*x^2 -9)/(x^2 -4)"
differentiate(a,:x)
differentiate(b,:x)
differentiate(f,:x)
differentiate(g,:x)
#method 2
@variables x
D = Differential(x)
a = 3*x^2 -2*x + log(x)
D(a)
expand_derivatives(D(a))
b = cos(x)*2*x
D(b)
expand_derivatives(D(b))
g = (2*x^3+ 4*x^2 -9)/(x^2 -4)
D(g)
expand_derivatives(D(g))
f = sin(2*x)
D(f)
expand_derivatives(D(f))

#Julia #mathematics #calculus