Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6956503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:52:42+00:00 2026-05-27T14:52:42+00:00

I want to use a function’s derivative in an other function. How should this

  • 0

I want to use a function’s derivative in an other function. How should this be done in Maxima?

E.g:

f(x) := 2*x^4;
g(x) := diff(f(x),x)-8;

Now g(x) yields 8x^3-8 as expected, but g(0) gives an error, since diff(f(0),0) doesn’t make sense. But then how should I properly define g?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:52:42+00:00Added an answer on May 27, 2026 at 2:52 pm

    Michael’s answer is good, but it does the differentiation everytime g(x) is called. (Also, normally you see it wrapped in a block statement to ensure that y is properly localized).

    There is a way to force the RHS to evaluate at the time of definition
    and with the general x.
    The syntax is

    (%i1) f(x) := 2*x^4;
                                                4
    (%o1)                            f(x) := 2 x
    (%i2) g(x) := ''(diff(f(x), x) - 8);
                                              3
    (%o2)                          g(x) := 8 x  - 8
    (%i3) g(0);
    (%o3)                                 - 8
    

    Compare with the block construct:

    (%i4) h(x) := block([y], subst([y = x], diff(f(y), y) - 8));
    (%o4)        h(x) := block([y], subst([y = x], diff(f(y), y) - 8))
    (%i5) h(0);
    (%o5)                                 - 8
    

    Notice (%o4) which shows that the RHS is unevaluated.

    Ref: http://www.math.utexas.edu/pipermail/maxima/2007/004706.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use this function from mongoid: person.update_attributes(first_name: Jean, last_name: Zorg) But I
I want to use this function EnumWindows(EnumWindowsProc, NULL);. The EnumWindowsProc is a Callback function:
i want to use .animate function but i have some problems i want to
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
I want to use the Split function on a string but keep the delimiting
I want to use this function to get contours and within these contours, I
I want to use a function on my html page but the content is
In javascript, when would you want to use this: (function(){ //Bunch of code... })();
I came across the function InterlockedExchange and was wondering when I should use this
as expected it invokes the function foo the first time, but when i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.