For Republicans and Democrats alike, passage of the $98.3 billion tax bill is a double-edged political sword, cutting into weaknesses and strengths.

Democrats went into the battle with an 18-month history of legislative failure. Worse, they had done next to nothing to take the edge off their most debilitating problem: the image of a party incapable of governance.

With the tax bill's passage, Democrats, particularly those in the House, regained some of their legislative stature. In perhaps the best floor speech of his career, House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) was a leader whose words brought silence, if not awe, into a chamber known for its partisanship and bickering.

And in the last-minute writing of the legislation, Rep. Dan Rostenkowski (D-Ill.), who had been on the sidelines of the debate, kept Republican feet in the fire. He forced conferees to keep in the tax bill provisions that were beginning to make business-oriented Republicans queasy over the prospect of what they were doing to corporate allies.

In addition, enactment of the tax bill with Democratic votes has effectively eliminated any possibility that the Republicans will be able, with any credibility, to blame economic conditions on Democratic stalling in the 97th Congress. Republican congressional candidates go into the November elections with the Reagan program modified, but generally intact.

Legislative stature for the Democratic Party in the House, however, does not necessarily translate into victory at the polls for individual Democrats on Nov. 2. As an aide to O'Neill noted the day after the vote on the tax bill, a number of the Democrats who supported President Reagan and voted for the bill "have Republican opponents recruited, financed and managed by the Republican National Committee accusing them of voting to raise taxes."

At the same time, it was the Democrats who provided the critical votes to allow Reagan to retain what has been an unbroken string of congressional victories. In doing so, they protected the president from the liability that plagued Jimmy Carter: an inability to win.

It was this prospect that prompted a number of liberal Democrats from safe districts, particularly blacks, to vote against the tax bill. They did not want to give another victory to a president who has successfully forced through Congress a string of cuts in Medicaid, welfare, food stamps and just about every domestic program of direct interest to many of their constituents.

The victory, however, was also costly to Reagan. Despite all disclaimers, the tax bill represented a major shift in his economic policies, if not the abandonment, at least temporarily, of supply-side principles.

When Rep. Newt Gingrich (R-Ga.), a leader of the suddenly dissident conservatives, complained that the tax bill was a "Jimmy Carter tax bill," he was, to a large extent, right. Under any normal circumstances, the measure would have surfaced in Congress as the fanciful proposal of a liberal Democratic tax reformer with little or no chance of passage.

Instead, it was the product of Sen. Robert J. Dole (R-Kan.), chairman of the Finance Committee. Dole had read polls showing that Reagan's 1981 budget and tax cuts were turning the image of the Republican Party back into the mold of a party for the rich and for business.

It was the worst possible posture in which to enter congressional elections for a party with an incumbent president and a recession. Dole's tax bill undertook to counter the image by closing loopholes for the rich and for corporations.

Along the way, the bill sliced out some tax provisions enacted just last year -- including one that allowed companies to sell off unusable tax credits. And it reduced corporate depreciation schedules that had created a system so favorable that companies could make money from the corporate income tax.

Reagan, who effectively lost control of the tax-writing process to Dole, was forced to endorse the legislation, a step that split his own party down the middle.

While the GOP's right wing and the groups that support it are more conservative than the electorate as a whole, they have been one of the most vigorous elements in the resurgence of the GOP, providing money, manpower and ideological fervor.

Richard Viguerie, publisher of the Conservative Digest and a leader of the right-wing revolt against the administration, said the president "has disappointed and disillusioned many of his supporters. He's made it that much harder for us to help mobilize support."

It is not clear how much the split over the tax bill will damage the GOP's political unity in the 1982 elections, but the vote did divide the Republican Party in the House, the first time that has occurred since Reagan took office.

At the same time, however, enactment of the tax bill is a major factor in what has been a record-setting increase in stock market prices, and coincides with a sharp drop in interest rates.

Again, it is not clear how strong these economic gains are, and Republicans already are saddled with a recession in an election year. But any sustained improvement as election day nears is likely to reduce anticipated GOP losses. Republicans, as the party in power, are the most likely to be penalized or rewarded for the state of the economy.