Ducks defenseman Jaycob Megna, left, and Capitals center Chandler Stephenson battle for the puck. (Mark J. Terrill/Associated Press)

ANAHEIM, Calif. — The Washington Capitals would have been disappointed with themselves after Sunday’s 5-2 loss to the Anaheim Ducks no matter the circumstances, but what made it especially maddening was the optimism that preceded the lackluster effort.

Their big win against the Sharks three nights earlier felt like something the team could build on as the postseason draws nearer, but instead the Capitals on the ice in Anaheim hardly resembled the Capitals from San Jose.

The first half of this six-game road trip, Washington’s longest of the season, has underlined the inconsistency that has plagued the Capitals all year. The team was shut out in Columbus, a 3-0 loss that was one of its lousiest performances of the season, but followed it with a 5-1 win against the Sharks, perhaps the Capitals’ most complete effort since Christmas, especially considering the quality of the opponent.

Then, on Sunday night in Anaheim, Washington reverted to bad habits. Gone was the detail and discipline that cut down on the Sharks’ odd-man rushes and kept the Capitals out of the penalty box most of the night. The team was doomed by a handful of infractions at the start of the third period, when two Ducks power-play goals turned a tied game on its head within five minutes. Washington felt fortunate to even be in the game entering that final frame after its loose play in the first 40 minutes.

“We beat the team with the best home record, and then we go in here and just kind of don’t perform to the level we’re capable of,” center Lars Eller said. “It’s a bit of a roller coaster as far as that goes right now.”

Said defenseman Brooks Orpik: “There’s going to be games you lose, but if you’re playing consistently and doing the same thing over and over, there’s going to be some nights you don’t get the results but you’re happy with the effort you put in. Right now, I think ‘inconsistent’ is a good word to describe it.”

And how does that get remedied?

“Everybody’s got to evaluate themselves honestly,” Orpik said. “I think sometimes you get into the second half of the year, and sometimes you back off practice a little bit. But if you’re not going to practice as much, the practices you do have, you’ve got to be sharp.”

Through Sunday’s slate of games, the Capitals still have the second-most points in the Metropolitan Division with 71 — the New York Islanders have played one fewer game and have a five-point cushion — but their margin of error is dwindling. The Columbus Blue Jackets are just two points back of Washington, but they’ve played two fewer games than the Capitals. The Pittsburgh Penguins, currently the first wild-card team, are also two points back, and the Carolina Hurricanes, just outside of playoff position, have 68 points, three shy of Washington.

And the areas in which the Capitals have actually shown some consistency are what’s hurting them. They have cut down on the quantity of penalties they’re taking, but the infractions are still happening at poor times, like at the start of the third period when the game is tied. Many of the goals against them have come from directly in front of the net, the result of not boxing out well enough to keep opponents from getting second-chance opportunities off rebounds.

They remain the worst team for faceoffs in the NHL, and while they largely cleaned up their neutral-zone play coming out of the bye week at the start of the month, the theme in their losses has been breakdowns there that lead to a host of odd-man rushes.

“It’s kind of just ping-ponging back and forth,” Orpik said. “Obviously, when you get later in the season, everybody tightens up, so you’ve got to be consistent with what you’re doing, and if you’re not, you get what you deserve.”

The rest of the road trip doesn’t do the Capitals many favors. They enter Monday’s game against the Kings, the second of a back-to-back set, with just one win in their past 10 games in Los Angeles. Then the team travels back East to play the Toronto Maple Leafs, who have won the first two meetings this season. And finally, the Capitals will bus to Buffalo to play a Sabres team just outside the playoff picture, desperate to pick up points.

Meanwhile, the Feb. 25 trade deadline is approaching, and if the uneven play continues, roster changes could await.

“It’s just what you ask of yourself,” defenseman John Carlson said. “We’ve got to hold each other accountable to play at that level all of the time and not just when we feel like it, or if something goes wrong in a game and we pick it up. We’ve got to keep our level that high all of the time, and that’s on the players. …

“These are important games and important points. Everything’s so tight right now that we’ve got to work through this and start getting hot quickly.”