Skip to content

Derivatives #16

@k4b7

Description

@k4b7

Derivatives can be taken multiple times, this is usually referred to as the "order" of the derivative, e.g. 1st order, 2nd order, etc.

Derivatives can be take of different variables if the expression contains multiple variables, e.g. d^2/dxdy (x^2 + y^2).

There are also lots of way to specify the notation, but since we only care about semantics let's ignore representation for now.

Here are some expressions and possible AST representations:

f' --> { type: 'Apply': op: 'diff', args: [ f, _ ] },
f'' --> { type: 'Apply': op: 'diff', args: [ f, _, _ ] },
dy/dx --> { type: 'Apply': op: 'diff', args: [ y, x ] },
d/dx x^2 --> { type: 'Apply': op: 'diff', args: [ x^2, x ] },
d^2/(dxdy) (x^2 + y^2) --> { type: 'Apply': op, 'diff', args: [x^2 + y^2, x, y] },

The reason for going with diff instead of Derivative for the op specifier is that I'd like to continue to use MathML as an inspiration and they use diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions