Zulip Chat Archive

Stream: new members

Topic: How to calculate a easy function's derivative?


ShatteredLead (Mar 27 2025 at 07:05):

I tried

import Mathlib
open Real
example:  deriv (fun x :  => 3 * x - 4 * x ^ 3) = (fun x => 3 - 12 * x ^ 2) := by simp

But simp made no progress

Kevin Buzzard (Mar 27 2025 at 07:27):

Can you write your question as a #mwe ?

Etienne Marion (Mar 27 2025 at 08:18):

Here is a way:

import Mathlib

example : deriv (fun x :  => 3 * x - 4 * x ^ 3) = (fun x => 3 - 12 * x ^ 2) := by
  ext x
  rw [deriv_sub, deriv_const_mul, deriv_id'', deriv_const_mul, deriv_pow]
  · ring
  all_goals fun_prop

Last updated: May 02 2025 at 03:31 UTC