Total heat flux $Q$ across a surface can be written as

$Q = \displaystyle \oint_S \mathbf{q} \cdot \mathbf{\hat{n}}$,

where $\mathbf{\hat{n}}$ is the unit normal vector orthogonal to the surface $S$, and $\mathbf{q}$ is the (vector) heat flux per unit surface.

**Fourier's law.** Fourier's law states that the heat flux per unit surface is linear with the temperature gradient $\nabla T$. 

**Fourier's law in 3D.** General form of Fourier's law in 3D physical space reads

$\mathbf{q} = -k \, \nabla T = - k \left[ \dfrac{\partial T}{\partial x} \mathbf{\hat{x}} +  \dfrac{\partial T}{\partial y} \mathbf{\hat{y}} +  \dfrac{\partial T}{\partial z} \mathbf{\hat{z}} \right]$

 for an isotropic medium, i.e. the heat-flux per unit of area $\mathbf{q}$ is locally proportional to the temperature gradient $\nabla T$, through the conductivity $k$.

**Fourier's law in 1D.** Looking at an elongated element, such as a structural beam/rod with isolated surface or a pipe containing fluid at rest, we can approximately assume that the behavior of this system is approximately 1-dimensional, with the heat conduction occurring only along the axial direction $x$. Fourier's law thus reduce to its $x$-component only

$q_x = - k \dfrac{d T}{d x}$,

where we can use ordinary derivative assuming all the functions depend only on one variable, namely $x$ coordinate, and the total heat flux is

$Q = \displaystyle \int_S \mathbf{q} \cdot \mathbf{\hat{n}} = \int_S q_x \mathbf{\hat{x}} \cdot \mathbf{\hat{x}} = q_x \, A$.

**Fourier's law in 1D steady problem without heat source.** Internal energy equation for 1D steady problem without heat source can be written as

$\dfrac{d q_x}{d x} = 0$

and thus $q_x = - k\dfrac{dT}{dx} = \overline{q}_x = \text{const}$, and thus the temperature profile in space is linear

$T(x) = -\dfrac{ \overline{q}_x }{k} x + C = A x + C$.

To complete the differential problem, you need boundary conditions. As an example, if you know the temperature at two locations $T(x_0) = T_0$, $T(x_1) = T_1$, you can write the temperature and the heat flux as

$T(x) = T_0 + (T_1 - T_0 ) \dfrac{x-x_0}{x_1 - x_0}$  
$q_x = - k \dfrac{T_1-T_0}{x_1-x_0}$