/** Create a symbol with the name of the given string. */
makeSymbol[s] :=
{
if type[s] == "Symbol"
return s
else
return constructExpression["Symbol", [s]]
}

/** Create a derivative expression of the specified function. It currently
assumes that the function only has one argument.

This will create a function call expression of the form:
D[expr, symbol]

Which can then be passed to transformExpression[]
(once you have loaded a file like derivatives.frink) to actually
symbolically evaluate the derivative. At the moment, we don't do that in
this library so as not to create a dependency on a file that may change.

This, of course, will not behave properly if the function body is not
simple and directly differentiable.
*/
makeDerivative[f, times=1] :=
{
makeDerivativeFunction[functionBody[f], functionArgumentsAsSymbols[f]@0, times]
}

/** Create a Derivative function of the specified expression and symbol to
take the derivative with respect to. This will create a function call
expression of the form:
D[expr, symbol]

Which can then be passed to transformExpression[]
(once you have loaded a file like derivatives.frink) to actually
symbolically evaluate the derivative. At the moment, we don't do that in
this library so as not to create a dependency on a file that may change.

REMINDER: You may need to wrap expr or symbol in a noEval[] block if
passing in a literal expression
*/
makeDerivativeFunction[expr, symbol, times=1] :=
{
if type[symbol] == "String"
symbol = makeSymbol[symbol]

/** Create a integral expression of the specified function. It currently
assumes that the function only has one argument.

This will create a function call expression of the form:
D[expr, symbol]

Which can then be passed to transformExpression[]
(once you have loaded a file like integrals.frink) to actually
symbolically evaluate the integral. At the moment, we don't do that in
this library so as not to create a dependency on a file that may change.

This, of course, will not behave properly if the function body is not
simple and directly differentiable.
*/
makeIntegral[f] :=
{
makeIntegralFunction[functionBody[f], functionArgumentsAsSymbols[f]@0]
}

/** Create an Integral function of the specified expression and symbol to
take the derivative with respect to. This will create a function of the
form:
Integrate[expr, symbol]

Which can then be passed to transformExpression[]
once you have loaded a file like integrals.frink

REMINDER: You may need to wrap expr or symbol in a noEval[] block if
passing in a literal expression
*/
makeIntegralFunction[expr, symbol] :=
{
if type[symbol] == "String"
symbol = makeSymbol[symbol]