# Differentiating an argument from authority from expert testimony

Consider the following argument :

The mathematical theorem T is a true theorem, because person(s) P say so.

In a scientific context, it would be a fallacious argument from authority.

However, suppose that in a court setting, the truth of the theorem T would have to be dealt with. An expert mathematician would testify before court, and would testify that indeed the theorem T is a true one. The theorem T would be accepted by the court, because it was said to be true by an expert witness (or said to be accepted by the scientific community by an expert witness).

Is it a case of the same argument being fallacious / valid in different contexts?

If so, how come there is no contradiction in the same argument being fallacious/valid based on context?

• There seems to be a premise here that the only (reasonable) way to convince someone of something is via a formal proof. That isn't true. If you are required to follow the structure of a formal proof, then argument from authority is an invalid step. Otherwise, citing an authority can often be reasonable and convincing.
– usul
Feb 26 at 4:05
• – Dave
Feb 26 at 17:21
• Expert witness testimony is not presumed to be true, or even impartial. Feb 27 at 20:11
• "It is more probable that T is true if P said so" can be true without implying "P says T is true -> T is true".
– Ray
Feb 28 at 21:55
• Further to HymnsForDisco's Comment, I see no useful difference between your authority and testimony. Similarly, there might be cases of the same argument being fallacious / valid in different contexts and can you cite two or three examples? That might include whether we should stand our ground or run away and live to fight another day… but is that really an 'argument'? Feb 28 at 22:08

If you try to analyze the argument from authority fallacy in formal terms, it reduces to non sequitur:

(1) X says that P.
(2) P.

(1) doesn't follow from (2), so this is a simple non sequitur (a fallacy). That's not very useful, critiquing A as an "argument from authority" is less about saying it's a formal fallacy (most things are), but an informal fallacy, meaning that it is not really about validity of an argument, but about the strength of an argument. Historically, it was called a fallacy because it was used like this:

(3) Aristotle says that the world is made up of four elements.
(4) Therefore, the world is made up of four elements.

or this

(5) The pope says that Galileo is spreading misinformation.
(6) Therefore Galileo is spreading misinformation.

## Argument Strength

Because conclusions are false, and the premises are true, the forms must be fallacies. But so is all empirical reasoning. What really matters is the strength of connection from the premise to the conclusion. In both cases, there is a question of what knowledge the authority has which would lead us to trust his opinion.

There are lots of cases where argument from authority is considered strong (not strictly valid of course, but strong). For example,

(7) X says that P.
(8) X is an expert in the subject matter of P and has no reason to lie.
(9) Therefore P.

or this,

(10) X says that P
(11) X was a witness to P and has no reason to lie.
(12) Therefore P.

Both of these are strong arguments, but not valid arguments, because the expert could still be wrong. (Aristotle for example, or Newton on the nature of light.) But in the real world there are almost no valid arguments, only strong or weak.

## Strengthening the Connection

We can make the arguments valid by strengthening the "authorization premise" from "X is a witness/expert and has no reason to lie" to "X is right", but that's begging the question. What we can reasonably do is add premises that make it less likely they are wrong (or lying), and make the argument valid (not a fallacy) by adding the (implicit) authorization premise, "these co-premises entail we can believe X that P", and then asses the strength of that authorization premise.

## Questioning the Connection

There are, of course several factors which may weaken an authorization premise. X may be an expert in the subject matter, but the subject matter may not lend itself to reliable knowledge. Aristotle is a good example. Aristotle was an expert in the cosmology of his day, but the cosmology of his day was completely imaginary. Another example may be a football expert who confidently tells you that a particular team is going to win. In most football games, there is simply no way to tell with any confidence who is going to win, so no matter how confident the expert is, quoting him is not a strong argument. In the case of witness testimony, just because someone witnessed an event doesn't mean that they had a good view or that they were paying attention to the critical detail.

So there are various ways to impeach an expert, but even if you do, calling an argument based on that expert's testimony a fallacy is a bit pretentious; doing so smacks of bluster more than rational discourse. A more accurate and less pretentious response is to say that the argument is weak.

David Schum spent a career on legal and evidential reasoning. See for example, Schum & Morris 2007. Assessing the competence and credibility of human sources of intelligence evidence: contributions from law and probability. Law, Probability and Risk 6 247-274. doi:10.1093/lpr/mgm025

At minimum accepting expert/witness testimony requires assessing: Observational Sensitivity, Objectivity, and Veracity (not lying):

• I mean you say a lot of good stuff here, but argument from authority IS a non sequitor which IS a formal fallacy so the validity or the lack of is a matter of the form, which it fails to adhere to. Though you're correct that is not particularly useful as people usually are aware that an expert isn't all knowing and that there is a risk involved in trusting them. So you're correct to shift from the deductive valid to the inductive strong/weak argument. But that doesn't change the fact that it's a formal fallacy, does it? Feb 26 at 11:27
• @haxor789 The point is that "argument from authority" and "argument from expert testimony" are different forms of argument, because the latter has an additional premise. The question asks how these two kinds of argument can be distinguished, and this answer directly addresses that question; and the answer already acknowledges that arguments from expert testimony are "not valid arguments" in the formal sense. Feb 26 at 15:24
• Feb 26 at 15:47
• @haxor789, arguing from authority is not a deductive argument, so it can't be a formal fallacy. Feb 26 at 16:27
• Minor point : You say "an informal fallacy, meaning that it is not really about validity of an argument, but about the strength of an argument." But isn't the distinction between formal and informal fallacies something else? Formal fallacies are such due to the structure of the argument (eg affirming the consequent) but informal fallacies are such due to the content of the premises?
– Sam
Feb 27 at 13:39

"Appeal to authority" (or appeal to expertise) might be one of the most misunderstood and misapplied forms of argument (and that's in terms of both people inappropriately appealing to authorities, as well as people inappropriately accusing people of a fallacy when they appropriately appeal to authorities).

Every person on the planet can only know so much. Someone can dedicate every waking moment of their life to gaining knowledge, and they'll only manage to make their way through some minuscule fraction of a single scientific field.

It's integral to the functioning and advancement of society to have certain people focus on gaining knowledge in specific areas, and for the rest of us to trust and build upon the knowledge they share.

This, in itself, is not a fallacy. It's a necessity.

There are, however, a couple of guidelines for when it is reasonable to trust an authority or expert:

• When their field has a history of producing reliable results and uses a robust method, i.e. trust a biologist, don't trust a psychic. Someone having expertise in clairvoyance means essentially nothing, less than nothing, perhaps, because their methodology is bad, and their results are unreliable.

• When their views are consistent with the consensus of experts in that field (or just trust the consensus directly). "Most experts disagree, but I found one expert who agrees with me" is the exact wrong way to appeal to expertise. If you want to trust something merely because it's what experts say, you'd logically have to trust what most experts say, because that's more likely to be reliable. The only person who would be justified in trusting one expert against many experts (just on the basis of them being an expert) is that one expert, because they have the expertise to trust their own understanding and evaluation of the evidence. Although they should certainly be on the lookout for any cognitive biases that may be leading them to unjustified conclusions.

• When the subject they're commenting on actually reflects their expertise. Someone being a PhD doesn't make them an expert in every field, yet people commonly act as if it does.

• Conversely, you might refrain from appealing to authority when debating the topic with an authority or when performing research on the topic oneself.

The whole point of appealing to authority is recognising the limits of our own knowledge and relying on experts to have the relevant knowledge. If you're trying to dig into and challenge that knowledge by debating an authority or researching the topic, simply referring back to authorities would be somewhat circular. Although knowledge comes in parts - you can debate or research one part of a topic and, within that debate, appeal to authority for some dependent part. For example, if you're debating whether you can have a healthy diet by cutting out certain food groups, you may appeal to authority about which nutrients people need and make a case using that knowledge.

If you're trying to debate the topic with a layperson, it would be perfectly valid for them to say something like "I don't know enough about this topic, so I'm not going to debate you; the consensus among experts is X; if you want to debate someone, go and debate an expert". The key difference here is that this person wouldn't be debating the topic, they'd just be citing the consensus, and appealing to the fact that experts know much more about the topic that they do. Of course this doesn't mean that someone can't respond with why the consensus is wrong or why we shouldn't trust it, which the other person may or may not choose to engage with.

As an example, a layperson might trust what scientists tell them, but if they go on to become a scientist themselves, they should be much more inclined to question things within their field (while still trying to make progress in expanding humanity's knowledge, rather than just spending their career revalidating existing knowledge).

If a layperson finds a reason to doubt scientists, they could of course also research the topic themselves. Although it is difficult to compete with the knowledge one would gain from years of formal education and years or decades of professional research experience (without going through that process oneself). So if one embarks on such an endeavour, one should do so with humility and with the primary goal of understanding before one starts with trying to disprove anything. But this is getting a bit off topic.

I haven't mentioned courts yet, but the guidelines I mentioned above applies there too.

Regarding formal logical arguments, one could say it's a fallacy to say "expert says X, therefore X is true".

However, one might instead reasonably say something like:

P1: It's reasonable to treat expert judgement as true.
P2: Expert judgement says X.
C: Therefore it's reasonable to treat X as true.

This answer makes the case for accepting premise 1, roughly speaking.

Although I'm more inclined to think in terms of abductive reasoning, and considering the explanatory power of various explanations, such as X being true and experts having good reasons to believing it, X being false and experts lying, X being false and experts having bad reasons for accepting it to be true, etc. In that sense, we'd say we have some collection of facts that includes experts claiming X, and the "best explanation" for those facts may be that X is true.

Abductive reasoning is more about figuring out how strongly a particular piece of evidence supports a particular explanation. Fallacies tend to apply more to deductive reasoning, although they can still apply to some extent if one thinks a particular piece of evidence supports a particular explanation more strongly than it actually does.

• This get at my thinking which is "it's more complicated than just an authority was cited as part of the argument" -- it involves more of the why/how of using the expert's assessment. If it is "the expert is an expert so probably has some insight into the issue" vs. "the expert is an expert so everyone should defer to their judgement".
– Dave
Feb 26 at 17:27
• "it's reasonable to treat X as true." This is a very different logical statement than "X is true." I think the distinction is lost on many people. We know that it's not that unusual for the majority of experts to be incorrect at some point on a subject in their field. This can lead to a sort of alternate concept of 'truth' where something is 'true' until it isn't true anymore. For example, I recently an article about a galaxy which shouldn't exist and how it may "upend what we know about dark matter" which is a strange thing to say. If what we 'knew' is wrong, we didn't really 'know' it. Feb 27 at 16:30
• Is not it true that when you say that appealing to authority, is not a fallacy - but a necessity, you are committing the fallacy of appealing to consequence? Just because something is necessary, it doesn't make it true... I say that tongue in cheek, since I do realize the value of what you are saying. Just nit picking, and saying that if appealing to authority is very useful, and without it we could not even survive - still that not mean it is not a fallacy.
– Sam
Mar 3 at 12:58
• @Sam If something is necessary for the functioning and advancement of society, to call that a "fallacy" (to imply that it's something you shouldn't do) seems like a problem with the definition of "fallacy". Or maybe it's just that definitions are blurry, not all fallacies are bad, this is beyond the limits of strict logical reasoning, or something else. Mar 3 at 20:07
• Yes, you are right. My comment verges on "fallacy mongering". philosophy.stackexchange.com/a/68254/48182
– Sam
Mar 4 at 9:16

I see a lot of good responses here, but the informal fallacy of the Appeal to Authority is often misunderstood. It is only the case that an appeal to the expertise is a fallacy IF the inference fails to meet certain criteria of good judgement about the expert. In other words, the Appeal to Authority is not defined as any time anyone anywhere appeals to an authority as evidence. It's a fallacy if the connection between the claim and the expertise is weak because the claim falls outside of the expertise of the expert. As WP puts it:

in particular circumstances, [an appeal to authority] is sound to use as a practical although fallible way of obtaining information that can be considered generally likely to be correct if the authority is a real and pertinent intellectual authority and there is universal consensus about these statements in this field.

Thus, unlike a formal fallacy in a formal argument which undermines the deductive validity and soundness, an informal argument can contain a quality appeal to the expertise of the claimant because inductive and abductive argumentation strive for cogency and strength, not validity and soundness. An easier way of saying that is that informal arguments are probabilistic, so under adequate conditions of probability, confidence of a proposition can be conferred by virtue of who is uttering the proposition with the caveat that even experts can be wrong.

So, in mathematics, we cannot accept the claim:

The theorem is true because Andrew Wiles says its true.

However, in a court of law, the same claim is perfectly acceptable. Why? That's because in law, the burden of truth allows us to make a looser claim, and then shift it to the counter-claimant. Now, the theorem is true unless the other side can produce an expert witness who contradicts Andrew Wiles. If that's the case, then burden of proof now falls to the argument between the experts who of course, will appeal to the mathematical method and their deductive arguments in math itself.

Informal fallacies derive, according to some, from arguments failing to be acceptable, relevant, and grounded. (See this answer here for more detail.) Therefore, in law, it is often quite productive to accept presumptive claims that are given by experts on their face as true, and then let someone else try to demolish them. It's better to think of a court of law more as rhetoric and less as an exercise in mathematical logic. It's a fool who enters a court of law and expects superior reason to prevail.

• Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Philosophy Meta, or in Philosophy Chat. Comments continuing discussion may be removed. Mar 1 at 10:29

Fallacy:

Doctor P says T.

Therefore T.

Straightforward appeal to authority.

Valid but useless:

Doctor P says T.

T is in category {X}, of which Doctor P has said many things other than T.

When Doctor P says things about category {X} they are always true.

Therefore T.

We don't know the future and nobody is right about anything forever, so line 3 is false and we can't trust the conclusion.

Fallacy again:

Doctor P says T.

T is in category {X}, of which Doctor P has said many things other than T.

When Doctor P has said things other than T about category {X} they have always been true so far.

Therefore probably T.

Now it's a hasty generalization. We may have good reasons not listed in our explicit premises to believe that T could be Doctor P's first false statement in {X}. (For example, we may know he has been bribed.)

Valid and useful:

Doctor P says T.

T is in category {X}, of which Doctor P has said many things other than T.

We have negligible other knowledge of T or X.

When Doctor P has said things about category {X} they have always been true so far.

Therefore probably T.

As usual for valid arguments our premises could be false, and if the premises are false then our conclusion is useless. But at least now our premises are possible and falsifiable.

Valid and more useful:

Doctor P says T.

T is in category {Y}, which is a subset of {X}. Doctor P has said many things about {X} other than T.

{Y} is such that Doctor P can reliably expect to suffer penalties for statements in {Y} which turn out to be false and can reliably expect to benefit from statements in {Y} only if they turn out to be true.

Doctor P is a person who responds to such incentives.

We have negligible other knowledge of T or {X} or {Y}.

When Doctor P has said things about category {X} they have always been true so far.

Therefore probably T.

That is: we start adding limited amounts of knowledge to the previous syllogism which lets us eliminate ways that Doctor P could end up making his first false statement in {X}, like having perverse incentives (line 3), or being high out of his mind (line 4).

• Argument from authority is an informal fallacy. I don't think it's particularly useful to analyze it deductively. Feb 25 at 13:56
• @DavidGudeman since any inductive argument can be magically transformed into a deductive argument by putting "probably" in the conclusion, I think it's almost always useful to analyze inductive arguments deductively.
– g s
Feb 26 at 21:04
• No, putting "probably" into the conclusion only turns an inductive argument into an inductive argument with a weaker conclusion. It's still not a deductive argument. Feb 27 at 2:26
• In fact, now that I've read your answer more thoroughly, I see that the two arguments you identified as valid are not valid at all. What rule of deduction do you think applies to them? Feb 27 at 2:30

The difference is that when mathematician Q is considering mathematician P's statement about theorem T, mathematician Q may be qualified to understand T and the proof of T himself. If so, then Q ought to do exactly that, because to understand something oneself is preferable to just taking the word of another.

In court, the judge is not qualified to evaluate the proof of theorem T; it is over the judge's head. So the judge has no other option but to take the word of P. It's the best evidence available to the judge about T.

"P says T, thus T" is equally strong in either case. But for mathematician Q, there is a stronger, overriding argument available ("I'll read the proof myself") which should be preferred, which is why "P says T, thus T" is not acceptable for Q, but is acceptable for the judge.

ABA - Experts and Opinions (4 pages):

https://www.americanbar.org/content/dam/aba/publications/pass_it_on/experts_opinions_witness_testimony_PIO_F14.pdf

Rule 702 can give you some guidance. It states: “A witness who is qualified as an expert by knowledge, skill, experience, training, or education may testify in the form of an opinion or otherwise if: (a) the expert’s scientific, technical, or other specialized knowledge will help the trier of fact to understand the evidence or to determine a fact in issue; (b) the testimony is based on sufficient facts or data; (c) the testimony is the product of reliable principles and methods; and (d) the expert has reliably applied the principles and methods to the facts of the case.”

The paper explains the pitfalls of expert witness testimony from the perspective of a lawyer trying to pick a credible expert witness whose credibility will be impeached by opposing counsel. The idea of a trial is that the opposing counsel has a motive to impeach the credibility of witnesses and the trier of fact gets to decide credibility. There is bias in the selection of experts on both sides of the case if each litigant offers expert testimony. Scientific or expert reasoning outside the confines of a formal legal trial is "tested" as credible or not credible by other political means unless one accepts the testimony by appeal to authority.

A "fallacious argument from authority" is fallacious because it is not certain.

The authority can be incorrect or lying. What you have done is transformed the reliability of statement X from (unknown) to (as good as my argument that the authority said it) and (as reliable the authority is).

In a court of law, their goal is not certainty. In a criminal trial in common law countries the threshold for conviction is beyond a reasonable doubt, and similarly in a civil trial it is preponderance of evidence.

If they reach a conclusion that is not true, that is acceptable to the legal system. It even has ways to rectify itself if that happens, with appeals and overturning precedent and the like.

An expert opinion is just a source of evidence. The counter party can and is expected to provide their own expert opinion disagreeing with the claims made - if no such expert is produced, then the court assumes the expert is correct in their area of expertise.

The court simply doesn't have the time to become an expert in the area of expertise, and is willing to be wrong if that is the price it has to pay to be right.

In an adversarial environment, it is the job of the other party to produce an expert that shows the first expert is wrong. Then they can determine the credibility of the experts and their claims.

If it turns out that two credible experts disagree about a claim by one party or the other, we have a claim that isn't supported by either a reasonable doubt or the preponderance of evidence via expert testimony.

Courts of Law are not about finding the Truth at any price. They are about finding reasonably high amounts of Truth at a reasonably low price, often depending on the stakes involved.

It's an invalid deduction and hence a fallacy in either context.

From the fact that someone is an expert does not follow that what they say is the truth. There are countless of examples of experts telling falsehoods, either deliberately (lies), due to external pressure (bribery, intimidation, etc.) or even by accident (genuinely held believes and hypotheses that turn out to be false).

So it does not follow that something is true just because an expert said it.

So to say that it is "valid" in the juridical context is a fallacy of equivocation. Because what "validity" refers to in the juridical context is different from what validity refers to in the logical context. So just because it's a lawful legal process does not mean that it's not still fallacious.

The overall problem is that much of our everyday lives (including the courts) is not happening in the realm of neat logical deduction but in the realms of the more fuzzy inductive reasoning. So rather then being able to deduce knowledge from facts, we mostly have to compile good assumptions from data.

Or in other words the realm of deduction deals with certainties, so any possible alternative to the proposed conclusion renders the argument defunct, because it's no longer certain. While in the real world there's not much that is ultimately certain, maybe nothing at all, so to show that there are circumstances under which the conclusion can be wrong isn't really this ultimate rebuttal it's more or less the intrinsic problem of any inductive argument.

Like if you are a bird watcher and have seen thousands of swans and all of them have been white and someone tells you about a swan that they have seen, what color do you think that swan has?

It's not certain that it is white, in fact there apparently are black swans in Australia, but given what you've compiled as data, it's still reasonable to assume it's white and not idk rainbow colored. Because unlike with rainbow colored swans, you've actually seen white swans, so they do exist, you've seen plenty of them, so it's likely no a fluke and even if it's an anomaly it's one that seems to hold in your vicinity and you've only seen white swans, so there actually might be a reason or advantage to that, that actually links the color and the animal.

It's not NECESSARILY true, in fact it's false and we know that, but given what that person has access to, it's a reasonable assumption. It is not cogent but it's a strong inductive argument.

Or let's take driving a motorized vehicle. We generally consider it to be safe. Which is a fallacy. It factually is a safety hazard and in fact it is the cause of thousands (of direct) deaths each year. Yet what is considered "safe" is not a neat binary of "does harm people" or "doesn't harm people", but it's a matter of numbers and statistics and the question of what the general population, law makers and/or experts deem to be "still acceptable harm".

So not only could it be wrong to say driving is safe, in fact we KNOW that it is wrong to say that, yet we still are able to make an argument that it is "safe enough" with respect to a risk/reward calculation of allowing or banning it.

And similarly in the juridical context the question is not about the deductive certainty, but about the inductive beyond reasonable doubt.

If you were to investigate a case into the minutest of details you could NEVER come to a verdict because you could always hide a god in the gap that would explain the action without the defendants unlawful involvement or vice versa that make the defendant unlawfully responsible despite exonerating evidence. Like they could have hired someone through infinite+1 other people. Meaning no one could be charged or everyone could be detained indefinitely.

The other problem is that science itself isn't really a matter of certainty. Like if you're told the value of X is Y then it's not really Y but you should picture a Gaussian bell curve with Y as the center spot. So what science gives you is Y +- dY where in that range Y-dY to Y-dY about 68.2% of times the measurement is in that region https://en.wikipedia.org/wiki/Standard_deviation#/media/File:Standard_deviation_diagram.svg

That doesn't mean that it is not possible for measurements to be correct and outside of that interval it's just less likely. And at some point you draw the line between 0.000....0000....00001% being technically still possible and being so unlikely that it is treated as impossible.

Don't get me wrong it is still a fallacy to dismiss it, but in practical terms you are playing the odds either way and there are more likely than not more relevant factors to be considered.

Also another point with regards to appeal to authority. As SystemTheory has touched upon, the role of the expert might not be to serve as axiom giver, but as a source of information for the judge/Jury/lawyers etc. So in the end it's not the expert who crafts the verdict but the judge, so the primary role of the expert might just be to inform the judge and the judge likely does not need to take their word at face value but can ask them to explain it in layman's terms or to ask for a second opinion or whatnot. So just because they are an expert does not mean their evaluation has to be treated as fact.

Though again while it is not certain fact, there's a good chance that it has still better odds then the opposite of a layman's perspective or guessing at random. Also "expert" isn't a protected description so anybody from a senior professional, to a hobbyist, to someone having seen a youtube documentary can serve as experts, depending on the expertise of the other people in the room.

Another question is what they are actually talking about, like if the expert is just there to determine the guilt and shine a light on what is standard procedure in certain situations, then it might not even matter if what they say is THE TRUTH, it's fully sufficient if the defendant though this to be the likely cause or evaluated their situation in that matter, regardless of whether it actually had been that.

TL;DR it's still a fallacy and invalid in the sense of deductive reasoning, but courts don't play by these rules but rather by inductive reasoning

Edit: Also with regards to an argument from authority it's often useful to think of the use-mention distinction. So when researchers cite a study by someone else that is not always just to make them appear more credible because they link themselves to someone with authority, it might just be a reference to avoid having to reiterate points that someone else has already made. So mentioning someone is not always used to exploit their authority.

Two cents.

Appeal to authority is a fallacy since it is a non-sequitur as already noted by others.

Being a fallacy does not mean that the conclusion cannot be true, but that mere appeal to authority by itself does not lead to that conclusion (non-sequitur).

As already noted we live in somewhat complex societies where one cannot get involved in every field of knowledge, so there is some specialization. The difference, from mere appeal to authority, in these cases, is that this expert knowledge is used only as shortcut and the expert should at any instant, if asked, be able to back up and explain the opinion with data both to colleagues and outsiders. Furthermore, in principle, everyone can become an expert in that field if so desired.

So our trust on expert testimony is based on these assumptions that at any point, if necessary, expert opinion can be backed up with data and anyone can verify it.

In other words, expert opinion and testimony is used only as a temporary substitute for sufficient argumentation that leads to the conclusion and which can be provided, in principle, at any time. It is another way of saying that the expert must be able to prove expertise, about the case concerned, on demand.

Only under these explicit, or implicit, assumptions is expert opinion, as used in our somewhat complex societies, different from mere appeal to authority.

• But why the soundness of an argument made in one context should be different from the soundness of the same argument made in a different context? After all, an argument is an argument, a series of statements leading to a conclusion.
– Sam
Mar 28 at 9:21
• @Sam I don't see where I said sth like that.. Mar 28 at 9:22

The difference is that one is a fallacy and the other need not be. If your expert gives a statement, the statement itself ought not to contain anything fallacious. Where a fallacy arises is if you insist that what your expert has said must be true because they are an expert.

So the fallacy lies in any claim of necessary truth you make about the expert's statement, not in the expert's statement itself.

In court cases, expert testimony is not automatically taken to be true. Indeed, courts are often presented with mutually contradictory findings from opposing experts, so it is impossible to accept them all as true.

If so, how come there is no contradiction in the same argument being fallacious/valid based on context?

This comes because in your second case ("Mr. X said it's true") this is not an appeal to the authority of Mr. X, but a shortcut for "Mr. X, our local expert, has analyzed the situation, has written an elaborate derivation with all the details leading to his conclusion, and hence, unless and until someone attacks that analysis, we act like what's said is true".

If there is no written analysis, then the implied notion is "if we asked Mr. X to explain all the findings and logical steps leading to the conclusion he could do so".

In your court case even the latter case would work perfectly fine (in principle) because the opposite party could always call Mr. X as witness and try to poke holes into the analysis; if they happen to be successful, then the question is moot (at that point we would not accept "Mr. X said it's true" anymore); and if they do not succeed in poking holes, that is a kind of indirect indication that it's probably true.

Differentiating an argument from authority from expert testimony

Expert testimony is not an argument. It is a first-person statement. Credentials can be confirmed and the testimony should be a verbatim statement from the expert.

An argument from authority uses expert testimony to give the argument credibility.