Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Nama : ludgerdus pati hurit

Nim: 2242102010

1. g=2*x+5

g = (sym) 2⋅x + 5

octave:3> diff(g)

ans = (sym) 2

f = x^2 + 2*x + 1
f = (sym)

2. 2
x + 2⋅x + 1

octave:8> diff(f)

ans = (sym) 2⋅x + 2


octave:9> diff(f, 2)

ans = (sym) 2

3. y = sin(x) + cos(x)

y = (sym) sin(x) + cos(x)


octave:12> diff(y)
ans = (sym) -sin(x) + cos(x)
octave:13> diff(y,2)
ans = (sym) -(sin(x) + cos(x))

syms x a

octave:15>
f = a*x^2 + 2*x + 4

f = (sym)
2
a⋅x + 2⋅x + 4

octave:16>
g = x^2 + a*x - 2

g = (sym)

2
a⋅x + x - 2

octave:17> h = f*g

h = (sym)

⎛ 2 ⎞ ⎛ 2 ⎞
⎝a⋅x + x - 2⎠⋅⎝a⋅x + 2⋅x + 4⎠

octave:18> dh = diff(h)

dh = (sym)

⎛ 2 ⎞ ⎛ 2 ⎞
(a + 2⋅x)⋅⎝a⋅x + 2⋅x + 4⎠ + (2⋅a⋅x + 2)⋅⎝a⋅x + x - 2⎠

octave:19> dh0 = subs(dh, x, 0)

dh0 = (sym) 4⋅a - 4


octave:20> eqn = dh0 == 1

eqn = (sym) 4⋅a - 4 = 1


octave:21>
sol = solve(eqn, a);

octave:22>
a_val = double(sol)

a_val = 1.2500
4. syms x
octave:24>
f = log(x^2 + 4*x)

f = (sym)

⎛ 2 ⎞
log⎝x + 4⋅x⎠

octave:25> df = diff(f)

df = (sym)

2⋅x + 4
────────
2
x + 4⋅x

octave:26> df = (2*x + 4)/(x^2 + 4*x)

df = (sym)

2⋅x + 4
────────
2
x + 4⋅x

syms x

octave:28>
f = 1/x^2 - 1/x + 1;

octave:29> df = diff(f)
df = (sym)

1 2
── - ──
2 3
x x

octave:30> df_half = subs(df, x, 1/2)

df_half = (sym) -12

5. syms x

octave:34>
g = 3 - x
g = (sym) 3 - x
octave:35>
f = 6*x^2 + 3*x - 9

f = (sym)

2
6⋅x + 3⋅x - 9

octave:36> h = g*f
h = (sym)

⎛ 2 ⎞
(3 - x)⋅⎝6⋅x + 3⋅x - 9⎠

octave:37> dh = diff(h)

dh = (sym)

2
- 6⋅x - 3⋅x + (3 - x)⋅(12⋅x + 3) + 9

octave:38> dh = -6*x^2 + 9*x - 3

dh = (sym)

2
- 6⋅x + 9⋅x – 3
6. syms x

octave:40>
f = log(x^2 - 3*x + 1)

f = (sym)

⎛ 2 ⎞
log⎝x - 3⋅x + 1⎠

octave:41> df = diff(f)
df = (sym)

2⋅x - 3
────────────
2
x - 3⋅x + 1

octave:42> df = (2*x - 3)/(x^2 - 3*x + 1)

df = (sym)

2⋅x - 3
────────────
2
x - 3⋅x + 1

7. syms x

octave:44>
f = 2*log(3*x^2 - 1)

f = (sym)

⎛ 2 ⎞
2⋅log⎝3⋅x - 1⎠
octave:45> df = diff(f)
df = (sym)

12⋅x
────────
2
3⋅x - 1

octave:46> df = (12*x)/(3*x^2 - 1)

df = (sym)

12⋅x
────────
2
3⋅x - 1

8. syms x
octave:48> y = (2*x^2 + 4)*(x + 6)

y = (sym)

⎛ 2 ⎞
(x + 6)⋅⎝2⋅x + 4⎠

octave:49> dy = diff((2*x^2 + 4)*(x + 6))


dy = (sym)

2
2⋅x + 4⋅x⋅(x + 6) + 4

octave:50> dy = 6*x^2 + 24*x + 4

dy = (sym)

2
6⋅x + 24⋅x + 4

You might also like