Components of a vector

Pick up any vector in three-dimensional space and there is a completely mechanical way to describe it with three numbers: how far it reaches along xx, how far along yy, how far along zz. Those three numbers are its components, and writing the vector as xi^+yj^+zk^x\hat i+y\hat j+z\hat k turns every geometric question about it — its length, its direction, what happens when you add it to another vector — into ordinary arithmetic. This is the tool that makes the rest of vector algebra computable rather than just pictorial. Once a vector is in component form, magnitude is a square root of a sum of squares, addition is done term by term, and direction cosines fall out by dividing by the magnitude. This article builds the idea from the standard basis vectors i^,j^,k^\hat i,\hat j,\hat k, derives the component and magnitude formulas, and works through the same numeric examples used throughout the Vector Algebra chapter.

The core insight

Any vector can be written as a1i^+a2j^+a3k^a_1\hat i+a_2\hat j+a_3\hat k, where a1,a2,a3a_1,a_2,a_3 are its scalar components along the axes, and this component form converts magnitude, addition, and scalar multiplication into simple arithmetic on those three numbers.

The core idea

Set up axes OXOX, OYOY, OZOZ through a common origin OO, mutually perpendicular. Along the positive xx, yy, zz directions there are three fixed unit vectors, written i^,j^,k^\hat i,\hat j,\hat k, satisfying ∣i^∣=∣j^∣=∣k^∣=1|\hat i|=|\hat j|=|\hat k|=1. These are not arbitrary — i^\hat i is literally the position vector of the point (1,0,0)(1,0,0), j^\hat j of (0,1,0)(0,1,0), and k^\hat k of (0,0,1)(0,0,1). Every other vector in space is built as a combination of these three.

Position vector of a point. For a point P(x,y,z)P(x,y,z), the position vector OP→\overrightarrow{OP} is

OP→=xi^+yj^+zk^,\overrightarrow{OP} = x\hat i + y\hat j + z\hat k,

where: x,y,zx,y,z are the scalar components of OP→\overrightarrow{OP} along the three axes, and xi^, yj^, zk^x\hat i,\ y\hat j,\ z\hat k are its vector components. The two terms sound similar but mean different things — a scalar component is a bare number, a vector component still carries a direction.

Components of a general vector. A vector does not have to start at the origin. For AB→\overrightarrow{AB} running from A(x1,y1,z1)A(x_1,y_1,z_1) to B(x2,y2,z2)B(x_2,y_2,z_2), the components come from subtracting the initial point's coordinates from the terminal point's:

AB→=(x2−x1)i^+(y2−y1)j^+(z2−z1)k^.\overrightarrow{AB} = (x_2-x_1)\hat i + (y_2-y_1)\hat j + (z_2-z_1)\hat k.

where: the order matters — it is always terminal minus initial, i.e. BB minus AA, never the other way round.

Magnitude from components. Once a vector is in the form a⃗=a1i^+a2j^+a3k^\vec a = a_1\hat i+a_2\hat j+a_3\hat k, its length follows from a three-dimensional Pythagorean-style sum:

∣a⃗∣=a12+a22+a32.|\vec a| = \sqrt{a_1^2+a_2^2+a_3^2}.

where: a1,a2,a3a_1,a_2,a_3 are the scalar components of a⃗\vec a along x,y,zx,y,z. Component form is what makes vector algebra genuinely computational. Geometric constructions like the triangle law or the parallelogram law are excellent for building intuition about why vector addition works, but they do not scale to an arbitrary vector in three dimensions when an exact numeric answer is needed. Component form fixes that: addition, subtraction, and scalar multiplication all reduce to doing the same operation on matching components, one axis at a time. It also feeds directly forward into direction cosines, l=a1∣a⃗∣l=\dfrac{a_1}{|\vec a|} and so on, and later into the dot and cross products, both of which are defined entirely in terms of components.

Figure
A three axis diagram showing a vector from the origin to point x y z resolved into three perpendicular component arrows along the x y and z axes
Resolving a vector into components along x, y, z x z y O P(x, y, z) x-component y-component z-component OP = x i-hat + y j-hat + z k-hat, three perpendicular pieces added together
Derivation AMagnitude of a vector from its components

This derivation shows why ∣a⃗∣=a12+a22+a32|\vec a|=\sqrt{a_1^2+a_2^2+a_3^2} follows from ordinary two-dimensional geometry applied twice, once in a horizontal plane and once vertically, rather than being an assumed extra rule bolted onto vector algebra.

Step 1. Take a⃗=OP→=a1i^+a2j^+a3k^\vec a = \overrightarrow{OP} = a_1\hat i+a_2\hat j+a_3\hat k for a point P(a1,a2,a3)P(a_1,a_2,a_3). Drop a perpendicular from PP to the point Q(a1,a2,0)Q(a_1,a_2,0) lying directly below it in the xyxy-plane. The segment OQOQ lies entirely in that plane, and QPQP is vertical, so triangle OQPOQP has a right angle at QQ.

Step 2. Inside the xyxy-plane, Q(a1,a2,0)Q(a_1,a_2,0) is reached from OO by moving a1a_1 along xx and a2a_2 along yy, which are themselves perpendicular directions. Ordinary two-dimensional Pythagoras on that right triangle gives OQ2=a12+a22OQ^2 = a_1^2+a_2^2, so OQ=a12+a22OQ=\sqrt{a_1^2+a_2^2}.

Step 3. Now apply Pythagoras to the right triangle OQPOQP, whose legs are OQOQ and QP=a3QP=a_3 and whose hypotenuse is OP=∣a⃗∣OP=|\vec a|. That gives OP2=OQ2+QP2=(a12+a22)+a32OP^2 = OQ^2+QP^2 = (a_1^2+a_2^2)+a_3^2.

Step 4. Take the square root of both sides: ∣a⃗∣=a12+a22+a32|\vec a| = \sqrt{a_1^2+a_2^2+a_3^2}. The same argument applies unchanged to AB→=(x2−x1)i^+(y2−y1)j^+(z2−z1)k^\overrightarrow{AB}=(x_2-x_1)\hat i+(y_2-y_1)\hat j+(z_2-z_1)\hat k, since it is just a position vector once the axes are shifted so that AA is the origin — so the magnitude of any vector between two points is (x2−x1)2+(y2−y1)2+(z2−z1)2\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}.

Worked example

Find the scalar components and the magnitude of AB→\overrightarrow{AB}, where A(2,−1,3)A(2,-1,3) and B(−4,5,1)B(-4,5,1). Then use a⃗=2i^+3j^−k^\vec a = 2\hat i+3\hat j-\hat k and b⃗=−i^+4j^+5k^\vec b=-\hat i+4\hat j+5\hat k to find the components and magnitude of 2a⃗−3b⃗2\vec a-3\vec b.

Step 1. Subtract AA's coordinates from BB's coordinates, terminal minus initial:

AB→=(−4−2)i^+(5−(−1))j^+(1−3)k^=−6i^+6j^−2k^.\overrightarrow{AB} = (-4-2)\hat i + (5-(-1))\hat j + (1-3)\hat k = -6\hat i + 6\hat j - 2\hat k.

So the scalar components of AB→\overrightarrow{AB} are −6-6, 66, and −2-2 along xx, yy, zz.

Step 2. Find the magnitude using ∣AB→∣=a12+a22+a32|\overrightarrow{AB}|=\sqrt{a_1^2+a_2^2+a_3^2}:

∣AB→∣=(−6)2+62+(−2)2=36+36+4=76=219.|\overrightarrow{AB}| = \sqrt{(-6)^2+6^2+(-2)^2} = \sqrt{36+36+4} = \sqrt{76} = 2\sqrt{19}.

Step 3. For the second part, scale each vector componentwise: 2a⃗=4i^+6j^−2k^2\vec a = 4\hat i+6\hat j-2\hat k and 3b⃗=−3i^+12j^+15k^3\vec b=-3\hat i+12\hat j+15\hat k.

Step 4. Subtract componentwise, matching xx with xx, yy with yy, zz with zz:

2a⃗−3b⃗=(4−(−3))i^+(6−12)j^+(−2−15)k^=7i^−6j^−17k^.2\vec a-3\vec b = (4-(-3))\hat i + (6-12)\hat j + (-2-15)\hat k = 7\hat i - 6\hat j - 17\hat k.

Step 5. Apply the magnitude formula one more time: ∣2a⃗−3b⃗∣=72+(−6)2+(−17)2=49+36+289=374|2\vec a-3\vec b| = \sqrt{7^2+(-6)^2+(-17)^2} = \sqrt{49+36+289} = \sqrt{374}. So AB→=−6i^+6j^−2k^\overrightarrow{AB}=-6\hat i+6\hat j-2\hat k has magnitude 219\mathbf{2\sqrt{19}}, and 2a⃗−3b⃗=7i^−6j^−17k^2\vec a-3\vec b = 7\hat i-6\hat j-17\hat k has magnitude 374\mathbf{\sqrt{374}}.

Competitive stretch

Once a⃗=2i^+3j^−k^\vec a=2\hat i+3\hat j-\hat k is known, its direction cosines follow immediately: ∣a⃗∣=4+9+1=14|\vec a|=\sqrt{4+9+1}=\sqrt{14}, so the direction cosines are (214,314,−114)\left(\dfrac{2}{\sqrt{14}},\dfrac{3}{\sqrt{14}},\dfrac{-1}{\sqrt{14}}\right). This is exactly the position-vector direction-cosine formula from earlier in the chapter, just applied to a general vector instead of only to OP→\overrightarrow{OP} — component form is what lets the same formula transfer over unchanged.

Common traps

  • Subtracting in the wrong order. AB→\overrightarrow{AB} is terminal minus initial (BB minus AA); doing it the other way silently computes BA→=−AB→\overrightarrow{BA}=-\overrightarrow{AB}, flipping every sign.
  • Mixing up scalar and vector components. For a⃗=a1i^+a2j^+a3k^\vec a=a_1\hat i+a_2\hat j+a_3\hat k, the scalar components are the plain numbers a1,a2,a3a_1,a_2,a_3; the vector components are a1i^, a2j^, a3k^a_1\hat i,\,a_2\hat j,\,a_3\hat k. Both terms show up in exam questions, so read carefully which one is being asked for.
  • Squaring negative components incorrectly. (−6)2=36(-6)^2=36, not −36-36; dropping the sign before squaring is one of the most common arithmetic slips in magnitude questions.
  • Treating raw components as direction cosines. The components x,y,zx,y,z equal the direction cosines only when ∣r⃗∣=1|\vec r|=1; for any other vector you must divide each component by the magnitude first.

Ask the tutor: stuck on whether to subtract A from B or B from A, or want a few more practice problems on finding components and magnitude? Ask the AI tutor.

Why do we bother writing vectors with i-hat, j-hat, k-hat instead of just listing three numbers like (a1, a2, a3)?

Both notations carry the same information, and many textbooks use them interchangeably. Writing a1i^+a2j^+a3k^a_1\hat i+a_2\hat j+a_3\hat k makes explicit that a vector is a sum of pieces along fixed reference directions, which matters once you start adding vectors, taking dot products, or computing cross products — those operations are defined in terms of the i^,j^,k^\hat i,\hat j,\hat k pieces, so keeping the basis vectors visible in the notation is a reminder of what is actually being combined.

Do the components of AB depend on where A and B are, or only on the vector's length and direction?

Only on length and direction. Two different segments with the same length and the same direction — for example AB→\overrightarrow{AB} from (0,0,0)(0,0,0) to (3,4,0)(3,4,0) and CD→\overrightarrow{CD} from (1,1,1)(1,1,1) to (4,5,1)(4,5,1) — give identical component vectors 3i^+4j^3\hat i+4\hat j, because only the coordinate differences matter, not the starting point. This is exactly why we can freely slide a "free vector" around without changing what it represents.

If two vectors have the same magnitude, must they have the same components?

No. Magnitude only fixes a12+a22+a32\sqrt{a_1^2+a_2^2+a_3^2}, and many different triples (a1,a2,a3)(a_1,a_2,a_3) can give the same value under a square root — for instance 3i^+4j^3\hat i+4\hat j and 4i^+3j^4\hat i+3\hat j both have magnitude 55 but are clearly different vectors pointing in different directions. Magnitude alone never determines a vector; you also need its direction, which is exactly what the individual components (or the direction cosines built from them) supply.

Before this

Where this leads