# Complex Mathematics Engine

## Links

- Product page URL: https://www.agentpmt.com/marketplace/complex-mathematics-engine
- Product markdown URL: https://www.agentpmt.com/marketplace/complex-mathematics-engine?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/complex-mathematics-engine?format=agent-json

## Overview

- Product ID: 689df4ac8ee2d1dd79e9035b
- Vendor: Apoth3osis
- Type: core utility
- Unit type: request
- Price: 500 credits
- Categories: Scientific Computing, Financial Modeling, Data Science, Mathematical Computing, Developer Tools
- Generated at: 2026-05-30T20:16:11.112Z

### Page Description

A universal math engine that intelligently executes mathematical and scientific expressions. An agent can submit a single expression string to solve a wide range of problems without needing to select a specific engine, ranging from simple arithmetic to advanced symbolic mathematics, numerical array operations, and scientific computing. It integrates three powerful computation backends: SymPy for symbolic mathematics including differentiation, integration, limits, series expansions, equation solving, and algebraic simplification; NumPy for numerical operations on arrays and matrices including linear algebra, element-wise operations, and statistical aggregations; and SciPy for scientific computing including probability distributions, optimization, curve fitting, special functions, and numerical integration. The engine automatically detects the appropriate back end based on expression syntax, or users can specify a preferred engine explicitly. Expressions support intuitive syntax including Unicode math symbols like π, ∞, and √ which are automatically converted, as well as caret notation for exponentiation. Symbolic results preserve variables and can be further manipulated, while numerical results are returned as JSON-serializable values with full precision. Built-in security validation prevents code injection while allowing access to a comprehensive library of mathematical functions. Results include execution timing, the engine used, and metadata about the computation including detected variables for symbolic expressions.

### Agent Description

Execute mathematical expressions using SymPy (symbolic), NumPy (numerical), or SciPy (scientific). Supports arithmetic, calculus, linear algebra, statistics, and equation solving with automatic backend detection.

## Details

### Details

A universal math engine that intelligently executes mathematical and scientific expressions. An agent can submit a single expression string to solve a wide range of problems without needing to select a specific engine, ranging from simple arithmetic to advanced symbolic mathematics, numerical array operations, and scientific computing. It integrates three powerful computation backends: SymPy for symbolic mathematics including differentiation, integration, limits, series expansions, equation solving, and algebraic simplification; NumPy for numerical operations on arrays and matrices including linear algebra, element-wise operations, and statistical aggregations; and SciPy for scientific computing including probability distributions, optimization, curve fitting, special functions, and numerical integration. The engine automatically detects the appropriate back end based on expression syntax, or users can specify a preferred engine explicitly. Expressions support intuitive syntax including Unicode math symbols like π, ∞, and √ which are automatically converted, as well as caret notation for exponentiation. Symbolic results preserve variables and can be further manipulated, while numerical results are returned as JSON-serializable values with full precision. Built-in security validation prevents code injection while allowing access to a comprehensive library of mathematical functions. Results include execution timing, the engine used, and metadata about the computation including detected variables for symbolic expressions.

### Actions

- `calculate` (5 credits): Evaluate a mathematical expression using SymPy (symbolic), NumPy (numerical/arrays), or SciPy (statistics/optimization). Supports calculus, linear algebra, statistics, and more.

### Use Cases

Calculus, Solve Derivative, Calculate Integral, Find Limit of Function, Algebra, Solve Equation for Variable, Simplify Polynomial, Factor Expression, Expand Formula, Linear Algebra, Matrix Multiplication, Invert Matrix, Solve Linear System, Calculate Determinant, Find Eigenvalues, Statistics, Calculate Mean, Find Standard Deviation, Compute Median, Linear Regression Fitting, Optimization, Find Minimum of Function, Numerical Optimization, Array Operations, Vector Math, Element-wise Calculation, Array Sorting, Symbolic differentiation, derivative calculation, calculus derivative, symbolic integration, integral calculation, definite integral, indefinite integral, limit calculation, limit evaluation, series expansion, Taylor series, equation solving, algebraic equation solver, system of equations, expression simplification, algebraic simplification, polynomial factoring, expression expansion, symbolic algebra, computer algebra system, CAS calculation, NumPy array calculation, matrix multiplication, dot product, cross product, linear algebra operations, matrix determinant, matrix inverse, eigenvalue calculation, array mean calculation, standard deviation, statistical aggregation, numerical computation, vector operations, array manipulation, reshape array, transpose matrix, SciPy statistics, probability distribution, normal distribution CDF, statistical hypothesis testing, curve fitting, optimization, minimize function, special functions, Bessel functions, gamma function, numerical integration, quadrature, interpolation, scientific computing, engineering calculation, physics calculation, mathematical expression parser, safe math evaluation, sandboxed calculator, AI agent math, LLM calculator integration, automated computation, workflow math operations, API calculator, programmatic math evaluation

### Workflows Using This Tool

#### Rental Property Cash Flow Analyzer

Analyzes rental property investment viability by calculating mortgage payments, computing net operating income and cash-on-cash returns, projecting cash flows, generating return visualizations, creating a comprehensive investment analysis report, and delivering it to the investor. Essential for real estate investors evaluating rental property acquisitions.

- Page URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer
- Markdown URL: https://www.agentpmt.com/agent-workflow-skills/rental-property-cash-flow-analyzer?format=agent-md
- Published: 2026-02-18T16:43:43.406Z

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "689df4ac8ee2d1dd79e9035b",
    "parameters": {
      "action": "calculate",
      "expression": "example_expression",
      "engine_hint": "auto"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

### Schema

#### Parameters

- Schema type: actions

```json
{
  "actions": {
    "calculate": {
      "description": "Evaluate a mathematical expression using SymPy (symbolic), NumPy (numerical/arrays), or SciPy (statistics/optimization). Supports calculus, linear algebra, statistics, and more.",
      "properties": {
        "expression": {
          "type": "string",
          "description": "Mathematical expression to compute. Supports SymPy, NumPy, and SciPy syntax. Examples: diff(x**2, x), np.mean([1,2,3]), stats.norm.cdf(0), solve(x**2 - 4, x). Max 50000 characters.",
          "required": true
        },
        "engine_hint": {
          "type": "string",
          "description": "Force a specific computation engine. 'auto' (default) automatically detects the best engine based on the expression.",
          "required": false,
          "enum": [
            "auto",
            "sympy",
            "numpy",
            "scipy"
          ],
          "default": "auto"
        }
      }
    }
  },
  "properties": {
    "action": {
      "type": "string",
      "description": "Use 'get_instructions' to retrieve documentation. Action to perform: calculate",
      "required": false,
      "default": "calculate",
      "enum": [
        "get_instructions",
        "calculate"
      ]
    },
    "expression": {
      "type": "string",
      "description": "Mathematical expression to compute. Supports SymPy, NumPy, and SciPy syntax. Examples: diff(x**2, x), np.mean([1,2,3]), stats.norm.cdf(0). Required for calculate action.",
      "required": false
    },
    "engine_hint": {
      "type": "string",
      "description": "OPTIONAL. Force a specific engine: auto (default), sympy, numpy, scipy.",
      "required": false,
      "default": "auto",
      "enum": [
        "auto",
        "sympy",
        "numpy",
        "scipy"
      ]
    }
  }
}
```

### Usage Instructions

# Complex Mathematics Engine (009) - Instructions

## Overview
Evaluate mathematical expressions using three powerful computation engines:
- **SymPy** — Symbolic math (calculus, algebra, equation solving)
- **NumPy** — Numerical computation (arrays, linear algebra, statistics)
- **SciPy** — Scientific computing (statistics distributions, optimization, special functions)

## Action: `calculate`

### Parameters
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `expression` | string | Yes | Mathematical expression to compute. Max 50,000 characters. |
| `engine_hint` | string | No | Force a specific engine: `auto` (default), `sympy`, `numpy`, `scipy`. |

### Engine Auto-Detection
When `engine_hint` is `auto` (default), the engine is chosen based on the expression:
- **SciPy** — Expressions containing `scipy.`, `stats.`, `optimize.`, `special.`, `interpolate.`, `integrate.`, `curve_fit`, `least_squares`
- **NumPy** — Expressions containing `np.`, `numpy.`, `array`, `zeros`, `ones`, `eye`, `linspace`, `arange`, `mean`, `std`, `dot`, `linalg.`
- **SymPy** — Expressions containing `diff`, `integrate`, `limit`, `solve`, `simplify`, `expand`, `factor` (and is the default fallback)

### Supported Syntax

#### SymPy Examples
- `diff(x**2, x)` — Differentiate x² with respect to x
- `integrate(sin(x), x)` — Indefinite integral of sin(x)
- `solve(x**2 - 4, x)` — Solve x² - 4 = 0
- `limit(sin(x)/x, x, 0)` — Evaluate limit as x approaches 0
- `simplify((x**2 - 1)/(x - 1))` — Simplify expression
- `expand((x + 1)**3)` — Expand polynomial
- `factor(x**2 - 4)` — Factor polynomial

#### NumPy Examples
- `np.mean([1, 2, 3, 4, 5])` — Calculate mean
- `np.std([1, 2, 3])` — Standard deviation
- `np.dot([1, 2], [3, 4])` — Dot product
- `np.linalg.det(array([[1, 2], [3, 4]]))` — Matrix determinant
- `np.linspace(0, 10, 5)` — Generate evenly spaced values

#### SciPy Examples
- `stats.norm.cdf(0)` — Standard normal CDF at 0
- `stats.norm.pdf(0, loc=0, scale=1)` — Normal PDF
- `special.gamma(5)` — Gamma function
- `stats.t.ppf(0.975, df=10)` — t-distribution critical value

### Unicode Support
The following Unicode symbols are automatically converted:
- `π` → `pi`, `∞` → `oo`, `√` → `sqrt`, `∂` → `diff`, `∫` → `integrate`
- `^` is converted to `**` for exponentiation

### Security
Expressions are sandboxed. The following are blocked:
- `import`, `exec`, `eval`, `compile`, `open` statements
- Access to `os`, `sys`, `subprocess`, `pathlib`, `shutil`
- Dunder attributes (`__`)
- Semicolons and newlines (no multi-statement expressions)
- Only whitelisted functions and namespaces are permitted

### Response Fields
- `expression` — The original expression submitted
- `engine_used` — Which engine processed the expression (`sympy`, `numpy`, or `scipy`)
- `execution_time_seconds` — How long the computation took
- `result` — The computed result (JSON-serializable)
- `result_str` — String representation of the result
- `metadata` — Additional info (result_type, variables if symbolic)

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Call the AgentPMT-Tool-Search-and-Execution tool with action 'get\_schema' and tool\_id 689df4ac8ee2d1dd79e9035b ("Complex Mathematics Engine"). Then call the same tool with action 'call\_tool', tool\_id 689df4ac8ee2d1dd79e9035b, and the parameters needed for my request.

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

This product has no public dependency products.