# Formula

In science, a formula is a concise way of expressing information symbolically, as in a mathematical formula or a chemical formula. The informal use of the term formula in science refers to the general construct of a relationship between given quantities.
The plural of formula can be either formulas (from the most common English plural noun form) or, under the influence of scientific Latin, formulae (from the original Latin).

## In mathematics

In mathematics, a formula generally refers to an equation or inequality relating one mathematical expression to another, with the most important ones being mathematical theorems. For example, determining the volume of a sphere requires a significant amount of integral calculus or its geometrical analogue, the method of exhaustion. However, having done this once in terms of some parameter (the radius for example), mathematicians have produced a formula to describe the volume of a sphere in terms of its radius:
    $V={\frac {4}{3}}\pi r^{3}.$
Having obtained this result, the volume of any sphere can be computed as long as its radius is known. Here, notice that the volume V and the radius r are expressed as single letters instead of words or phrases. This convention, while less important in a relatively simple formula, means that mathematicians can more quickly manipulate formulas which are larger and more complex. Mathematical formulas are often algebraic, analytical or in closed form.
In a general context, formulas often represent mathematical models of real world phenomena, and as such can be used to provide solutions (or approximate solutions) to real world problems, with some being more general than others. For example, the formula
    $F=ma$
is an expression of Newton's second law, and is applicable to a wide range of physical situations. Other formulas, such as the use of the equation of a sine curve to model the movement of the tides in a bay, may be created to solve a particular problem. In all cases, however, formulas form the basis for calculations.
Expressions are distinct from formulas in the sense that they don't usually contain relations like equality (=) or inequality (<). Expressions denote a mathematical object, where as formulas denote a statement about mathematical objects. This is analogous to natural language, where a noun phrase refers to an object, and a whole sentence refers to a fact. For example, $8x-5$ is an expression, while $8x-5\geq 3$ is a formula.
However, in some areas mathematics, and in particular in computer algebra, formulas are viewed as expressions that can be evaluated to true or false, depending on the values that are given to the variables occurring in the expressions. For example $8x-5\geq 3$ takes the value false if x is given a value less than 1, and the value true otherwise. (See Boolean expression)

### In mathematical logic

In mathematical logic, a formula (often referred to as a well-formed formula) is an entity constructed using the symbols and formation rules of a given logical language. For example, in first-order logic,
    $\forall x\forall y(P(f(x))\rightarrow \neg (P(x)\rightarrow Q(f(y),x,z)))$
is a formula, provided that $f$ is a unary function symbol, $P$ a unary predicate symbol, and $Q$ a ternary predicate symbol.

## Chemical formulas

In modern chemistry, a chemical formula is a way of expressing information about the proportions of atoms that constitute a particular chemical compound, using a single line of chemical element symbols, numbers, and sometimes other symbols, such as parentheses, brackets, and plus (+) and minus (−) signs. For example, H$_2$O is the chemical formula for water, specifying that each molecule consists of two hydrogen (H) atoms and one oxygen (O) atom. Similarly, O$^−$ $_3$ denotes an ozone molecule consisting of three oxygen atoms and a net negative charge.
${\ce {H-{\overset {\displaystyle H \atop |}{\underset {| \atop \displaystyle H}{C}}}-{\overset {\displaystyle H \atop |}{\underset {| \atop \displaystyle H}{C}}}-{\overset {\displaystyle H \atop |}{\underset {| \atop \displaystyle H}{C}}}-{\overset {\displaystyle H \atop |}{\underset {| \atop \displaystyle H}{C}}}-H}}$
* the empirical formula C$_2$H$_5$
* the molecular formula C$_4$H$_{10}$ and
* the condensed formula (or semi-structural formula) CH$_3$CH$_2$CH$_2$CH$_3$.
A chemical formula identifies each constituent element by its chemical symbol, and indicates the proportionate number of atoms of each element.
In empirical formulas, these proportions begin with a key element and then assign numbers of atoms of the other elements in the compound—as ratios to the key element. For molecular compounds, these ratio numbers can always be expressed as whole numbers. For example, the empirical formula of ethanol may be written C$_2$H$_6$O, because the molecules of ethanol all contain two carbon atoms, six hydrogen atoms, and one oxygen atom. Some types of ionic compounds, however, cannot be written as empirical formulas which contains only the whole numbers. An example is boron carbide, whose formula of CB$_n$ is a variable non-whole number ratio, with n ranging from over 4 to more than 6.5.
When the chemical compound of the formula consists of simple molecules, chemical formulas often employ ways to suggest the structure of the molecule. There are several types of these formulas, including molecular formulas and condensed formulas. A molecular formula enumerates the number of atoms to reflect those in the molecule, so that the molecular formula for glucose is C$_6$H$_{12}$O$_6$ rather than the glucose empirical formula, which is CH$_2$O. Except for the very simple substances, molecular chemical formulas generally lack needed structural information, and might even be ambiguous in occasions.
A structural formula is a drawing that shows the location of each atom, and which atoms it binds to.

## In computing

In computing, a formula typically describes a calculation, such as addition, to be performed on one or more variables. A formula is often implicitly provided in the form of a computer instruction such as.
    Degrees Celsius = (5/9)*(Degrees Fahrenheit - 32)
In computer spreadsheet software, a formula indicating how to compute the value of a cell, say A3, could be written as
    =A1+A2
where A1 and A2 refer to other cells (column A, row 1 or 2) within the spreadsheet. This is a shortcut for the "paper" form A3 = A1+A2, where A3 is, by convention, omitted because the result is always stored in the cell itself, making the stating of the name redundant.

## Units

Formulas used in science almost always require a choice of units. Formulas are used to express relationships between various quantities, such as temperature, mass, or charge in physics; supply, profit, or demand in economics; or a wide range of other quantities in other disciplines.
An example of a formula used in science is Boltzmann's entropy formula. In statistical thermodynamics, it is a probability equation relating the entropy S of an ideal gas to the quantity W, which is the number of microstates corresponding to a given macrostate:
    $S=k\cdot \ln W$
where k is the Boltzmann constant, equal to 1.380649×10$^{−23}$ J⋅K$^{−1}$, and W is the number of microstates consistent with the given macrostate.