ForHosting KIT · Developer Utilities

Square of a Complex Number Calculator

This square of a complex number calculator multiplies a complex number by itself and returns the answer in rectangular form.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the real and imaginary components of a + bi, and the calculator applies the binomial-square identity to produce the real and imaginary components of the result. It handles positive, negative, decimal, purely real, and purely imaginary values with the same deterministic calculation. The response is ready for algebra exercises, engineering formulas, software workflows, or a quick check of handwritten complex arithmetic.

Enter the real and imaginary components

Start by writing the complex number in rectangular form a + bi. Put a in the real field and b in the imaginary field. For example, enter 3 and 4 for 3 + 4i, or enter 3 and -4 for 3 - 4i. Both fields are required, even when one component is zero, because zero states that the component is present and has no value while an omitted field leaves the input incomplete. Use real numbers without appending i to the imaginary component. Integers, decimals, negative values, and zero are accepted, provided each value is finite. Text, infinity, and missing components cause an input error instead of being silently converted. That strict rule helps API clients find malformed data early and prevents a plausible-looking answer from an unintended coercion. A purely real number such as 7 is entered as real 7 and imaginary 0. A purely imaginary number such as -5i is entered as real 0 and imaginary -5. No polar conversion, angle, magnitude, or external complex-number library is needed before using the calculator.

Apply the binomial-square identity

The calculation comes directly from multiplying the number by itself: (a + bi)(a + bi). Expanding it as a binomial square gives a squared + 2abi + b squared times i squared. Because i squared equals -1, the last term changes sign and becomes -b squared. Collecting the ordinary and imaginary terms produces (a squared - b squared) + (2ab)i. The calculator therefore returns a squared minus b squared as the real component and twice a times b as the imaginary component. For 3 + 4i, the real component is 9 - 16, or -7, while the imaginary component is 2 times 3 times 4, or 24. The final rectangular result is -7 + 24i. Signs matter in both places: a negative imaginary input is squared positively in the real calculation but makes 2ab negative when the real input is positive. The algorithm follows this identity directly with a fixed number of arithmetic operations, so it has no random, network, or time-dependent behavior.

Read, verify, and reuse the result

The response contains separate real and imaginary fields, representing x + yi without requiring a formatted string to be parsed. This structure is convenient for passing the square into another equation, storing it as JSON, or displaying it with the sign style your application prefers. You can verify the result manually by checking the two identity components: x must equal a squared minus b squared, and y must equal 2ab. Another useful check uses magnitudes. The magnitude of a squared complex number equals the square of the original magnitude, although small last-digit differences can occur with decimal inputs because JavaScript uses finite binary floating-point arithmetic. Keep the returned precision for later calculations and round only when presenting a measurement. Inputs so large that their squared components exceed the finite numeric range are rejected rather than returned as infinity, which keeps the JSON result meaningful. This calculator returns the square, not either square root; squaring has one result for each input, whereas finding square roots generally produces two values. Automated API requests cost $0.002, and the tier-A calculation can also run directly in the browser.

Check complex algebra homework

Verify the expansion of (a + bi) squared and compare both rectangular components with handwritten work.

Prepare engineering calculations

Square complex quantities used in circuit, signal, wave, or control formulas without converting to polar form.

Build deterministic math workflows

Produce separate numeric components that software can consume directly in JSON-based calculations.

What formula squares a complex number?

For z = a + bi, the square is z squared = (a squared - b squared) + (2ab)i.

Why is b squared subtracted from a squared?

The expanded term b squared times i squared becomes negative because i squared equals -1.

Can I square a purely imaginary number?

Yes. Enter zero for the real part. For example, 0 + 5i squared returns -25 + 0i.

Does this calculator find complex square roots?

No. It squares one supplied complex number and returns its single result. Finding square roots is the inverse operation and usually returns two values.

What does an API calculation cost?

Each API request costs $0.002. The tier-A calculation is also designed to run free in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/complex-square

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/complex-square \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"real":3,"imaginary":4}'
{
  "real": 3,
  "imaginary": 4
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.complex_square",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →