Skip to main content

handyderivatives

PyPi link

A command line program to do some differential calculus. This is essentially a wrapper for some of SymPy's calculus tools. Here is SymPy's calculus documentation.

Right now it has the functionality listed below.

  • Differentiate elementary functions.
  • Get the gradient of a scalar field.

Installation

pip3 install handyderivatives

Running it

To get the derivatives for an arbitrary number of functions of a single variable.

handyderivatives -d 'f(x) = x ^ 2' 'g(x) = sin(x) + 2 * x'

To get the gradient for an arbitrary number of scalar functions.

handyderivatives -g 'f(x,y,z) = ln(x / (2 * y)) - z^2 * (x - 2 * y) - 3*z'

Or run that with one command.

handyderivatives -d 'f(x) = x ^ 2' 'g(x) = sin(x) + 2 * x' -g 'f(x,y,z) = ln(x / (2 * y)) - z^2 * (x - 2 * y) - 3*z'

To differentiate a list of functions in a file and output that to a LaTeX document.

handyderivatives --latex -f functions.txt
handyderivatives -l -f functions.txt

The -l flag can also be used in the earlier examples.

Help

usage: handyderivatives [-h] [--input-file FILE] [--latex] [--diff [DIFFERENTIAL [DIFFERENTIAL ...]]] [--gradient [GRADIENT [GRADIENT ...]]]

Command line differential calculus tool using SymPy.
Try running:
handyderivatives -l -g 'f(x,y) = sin(x) * cos(y)'

optional arguments:
  -h, --help            show this help message and exit
  --input-file FILE, -f FILE
                        Input file
  --latex, -l           Compile a LaTeX document as output
  --diff [DIFFERENTIAL [DIFFERENTIAL ...]], -d [DIFFERENTIAL [DIFFERENTIAL ...]]
                        Works for equations written in the form  'f(x) = x ^2'
  --gradient [GRADIENT [GRADIENT ...]], -g [GRADIENT [GRADIENT ...]]
                        Works for scalar functions written in form  'f(x,y,z) = x ^2 * sin(y) * cos(z)'

How the input file should be formatted

Edit a file that has functions listed one per line. The left hand side should be what your function will be differentiated with respect to, i.e f(x) . The right hand side will be the expression.

# This is how the file for the argument -f should be formatted.

c(x) = r * (cos(x) + sqrt(-1) * sin(x))
a(t) = 1/2 * g * t ** 2
f(x) = sin(x**2) * x^2
h(w) = E ^ (w^4 - (3 * w)^2 + 9) # Capital E is interpreted by SymPy as the base of the natural log.
g(x) = exp(3 * pi)               # So is exp(x), but written as a function taking an argument.
p(j) = csc(j^2)

If you don't format it like that you will likely run into errors. You can add comments.

Metadata

Release files for handyderivatives 2.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for handyderivatives 2.3.2
File Size Uploaded
handyderivatives-2.3.2.tar.gz 17.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for handyderivatives 2.3.2
File Interpreter ABI Platform
handyderivatives-2.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 kB

Release files / handyderivatives-2.3.2.tar.gz

Download URL handyderivatives-2.3.2.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
56d469eb0cbde32490c61f72ba64369aad0b93c73e51f3620c84b4b7280ad0c3
BLAKE2b-256 checksum
How to use checksums
c38f9f9243d0f5405499f2f75ce02e430b109cda99e9f8fe5fb9ba6195c0d096
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.10 Linux/5.11.0-38-generic

Release files / handyderivatives-2.3.2-py3-none-any.whl

Download URL handyderivatives-2.3.2-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17cd7d6e6b9e9bf76c796fbb50bbff8c9d19ac7c8f289d58f46f3a13fa1dc490
BLAKE2b-256 checksum
How to use checksums
837adbb5b18c5e818f061709a03c25a19dd51be7b647c7807efcda59ce1612c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.10 Linux/5.11.0-38-generic

Release history Release notifications | RSS feed

This release

2.3.2 This release

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page