Math::...vative(3pm)

πŸ’– Math::Symbolic::Derivative β€” the manual, but make it make sense πŸ’–

okay bestie, sit down, hydrate, because we're about to talk about Math::Symbolic::Derivative β€” that's the Math::Symbolic::Derivative page from the User Contributed Perl Documentation, and yes it's a real one, no cap. this is the module that does derivatives for Math::Symbolic trees. calculus girlies rise 🧚✨


🌸 NAME 🌸

Math::Symbolic::Derivative β€” literally here to derive Math::Symbolic trees. that's the whole job. that's the vibe. πŸ‘‘


✨ SYNOPSIS ✨

look at her go:

use Math::Symbolic::Derivative qw/:all/;
$derived = partial_derivative($term, $variable);
# or:
$derived = total_derivative($term, $variable);

two flavours, one dream. pick your fighter πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so. this module implements derivatives for Math::Symbolic trees, fr fr. here's the cute little plot twist: derivatives are Math::Symbolic::Operators, but their actual implementation lives over here in this module, because it is significantly more complex than how most operators get built. she's high maintenance but she delivers. πŸ’€

derivatives come in two flavours, bestie:

  • partial derivatives
  • total derivatives

now, explaining the precise difference between partial and total derivatives is, and i quote, beyond the scope of this document πŸ™ˆ. but in the context of Math::Symbolic? the difference is simple: partial derivatives derive in terms of explicit dependency on the differential variable, while total derivatives recognize implicit dependencies from variable signatures. that's it, that's the tea. πŸ“

partial derivatives are faster, have been tested more thoroughly, and are probably what you want for simpler applications anyway. so if you're unsure β€” go partial. she's the reliable bestie. 🫢

πŸŽ€ EXPORT πŸŽ€

none by default, sorry angel. but you may choose to import the total_derivative() and partial_derivative() functions. opt-in only, we don't do surprise imports here. ✨


πŸ’œ CLASS DATA πŸ’œ

the package variable %Partial_Rules contains partial derivative rules as key-value pairs of names and subroutines. very demure, very mindful, very %Partial_Rules. 🧚


🌈 SUBROUTINES 🌈

πŸ’… partial_derivative

takes a Math::Symbolic tree and a Math::Symbolic::Variable as argument. the third argument is an optional boolean that says whether or not the tree has to be cloned before being derived.

and here's the warning, okay, listen up: if that third argument is true, the subroutine happily stomps on any code that might rely on any components of the Math::Symbolic tree that was passed to the sub as first argument. it just 🦢 stomps. no remorse. clone responsibly. 😭

πŸ’… total_derivative

takes a Math::Symbolic tree and a Math::Symbolic::Variable as argument. the third argument is an optional boolean that says whether or not the tree has to be cloned before being derived.

and same deal, same energy: if it's true, the subroutine happily stomps on any code that might rely on any components of the Math::Symbolic tree that was passed to the sub as first argument. two subs, one chaotic streak. πŸ’€


πŸ‘‘ AUTHOR πŸ‘‘

please send feedback, bug reports, and support requests to the Math::Symbolic support mailing list: math-symbolic-support at lists dot sourceforge dot net. and please consider letting us know how you use Math::Symbolic β€” they genuinely wanna hear it. thank you, mwah 🫢

if you're interested in helping with the development or extending the module's functionality, hit up the developers' mailing list: math-symbolic-develop at lists dot sourceforge dot net.

list of contributors, aka the icons:

Steffen MΓΌller, symbolic-module at steffen-mueller dot net
Stray Toaster, mwk at users dot sourceforge dot net
Oliver EbenhΓΆh

🌟 SEE ALSO 🌟


and that's the whole page, bestie! periodt πŸ’– this was perl v5.40.0, dated 2024-09-16, and yes she ate. go derive something gorgeous. β­πŸ‘‘

πŸ“¦ where this page comes from